When executing several instances of any code in the same directory one or more of them could crash while trying to delete the CRASH file (even if they have different outdir and/or prefix). Fix: if CRASH file is not deleted just print a remark.

LP



git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@8157 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
paulatto 2011-09-21 10:18:42 +00:00
parent c1806a87c8
commit 7bf16c5699
1 changed files with 4 additions and 2 deletions

View File

@ -39,6 +39,7 @@ CONTAINS
LOGICAL :: exst, debug = .false.
CHARACTER(LEN=80) :: code_version, uname
CHARACTER(LEN=6), EXTERNAL :: int_to_char
INTEGER :: iost
! ... Intel compilers v .ge.8 allocate a lot of stack space
! ... Stack limit is often small, thus causing SIGSEGV and crash
@ -67,8 +68,9 @@ CONTAINS
INQUIRE( FILE=TRIM(crash_file), EXIST=exst )
IF( exst ) THEN
OPEN( UNIT=crashunit, FILE=TRIM(crash_file), STATUS='OLD' )
CLOSE( UNIT=crashunit, STATUS='DELETE' )
OPEN( UNIT=crashunit, FILE=TRIM(crash_file), STATUS='OLD',IOSTAT=iost )
IF(iost==0) CLOSE( UNIT=crashunit, STATUS='DELETE', IOSTAT=iost )
IF(iost/=0) WRITE(stdout,'(5x,"Remark: CRASH file could not ne deleted")')
END IF
ELSE