>From: John Reid <[log in to unmask]>
>Subject: Re: sync and stat_stopped_image clarification
>To: [log in to unmask]
>
>Anton Shterenlikht wrote:
>> I think I might have asked this question about a year ago.
>> There have been at least one new version of both Cray
>> and Intel compilers since then.
>> I'm still not sure what behaviour is correct.
>>
>> The program:
>>
>> use, intrinsic :: iso_fortran_env
>> implicit none
>> integer :: errstat=0
>> if ( this_image() .eq. 1 ) stop "kuku"
>> sync all ( stat=errstat )
>> if ( errstat .eq. stat_stopped_image) write (*,*) "mumu"
>> end
>>
>>
>> My understanding from MFE sec. 19.13.6
>> and FDIS (10-007r1) sec 8.5.7 par 2 is that
>> the correct behaviour of this program is:
>>
>> 1. Image 1 initiates normal termination
>> 2. At "sync all (stat=errstat)" errstat
>> becomes defined with "stat_stopped_image"
>> on all images, but image 1.
>> 3. Hence all images, but image 1, must output "mumu".
>>
>> The critical point, for me at least, is that
>> with the use of (stat=errstat) the programmer can
>> avoid error termination and continue until
>> the end of the program on all images.
>>
>> Am I wrong?
>
>No, I think you are right and both the compilers have bugs. This is what
>the standard says (8.5.7):
>
>If the STAT= specier appears in a SYNC ALL or SYNC IMAGES statement and
>execution of one of these statements involves synchronization with an
>image that has initiated termination, the variable becomes defined
>with the value of the constant STAT_STOPPED_IMAGE (13.8.2.24) in the
>intrinsic module ISO_FORTRAN_ENV(13.8.2), and the effect of executing
>the statement is otherwise the same as that of executing the SYNC
>MEMORY statement.
>
>Best wishes,
>
>John Reid.
John, thank you for the confirmation.
In the book you also say, last sentense of MFE sec. 19.13.6:
"Without a stat= specifier, the execution of such
a statement initiates error termination"
I cannot find such an explicit statement in FDIS sec 8.5.
Is it there?
Are compilers *obliged* to initiate error termination
in this case, or are *allowed* to do this?
Also, note 8.46 says:
"A processor might detect communication failure between
images and treat it as an error condition."
is it allowed for an image that has initiated normal
termination to sever communication with other images?
In that case initiating error termination at SYNC ALL,
even in the presence of STAT= specifier, seems to be
allowed by the standard.
I do find the whole issue of error termination confusing.
A lot seems to be processor dependent.
Many thanks
Anton
|