[J3] FORM TEAM statement NEW_INDEX= specifier & failed images
Malcolm Cohen
malcolm at nag-j.co.jp
Wed May 8 04:17:20 EDT 2019
Actually it’s even simpler than that. If only nine images execute the FORM TEAM statement, whether that’s because there were originally 10 and one failed, or whether there were only nine images to start with, and one of them specifies NEW_INDEX=10, anything can happen. You say it “will be assigned” the image index of 10, but since it’s already left the standard it could just as well set fire to your underpants.
Non-standard = non-standard. The rules in 11.6.9p4 are violated, end of “the standard” story.
A “checking” implementation might detect and report this as an error, maintaining the rest of the Fortran semantics, but technically the wheels have already fallen off.
Similarly, the assertion about what is assigned to STAT= if that rule violation is not detected is unwarranted. It might assign STAT_FAILED_IMAGE to it, or it might buy you a new cup of coffee. One might *hope* that the implementation does something “sensible”, but ( a ) that is just a pious hope; ( b ) reasonable people may differ as to what is “sensible”. Personally I might lean towards “a new cup of coffee” being more sensible for this particular rule violation (or some stronger drink, seeing as how image indices outside the range 1-num_images could well lead to deadlocks, seg faults, or just plain incomprehensible behaviour).
Cheers,
--
..............Malcolm Cohen, NAG Oxford/Tokyo.
From: J3 <j3-bounces at mailman.j3-fortran.org> On Behalf Of Steidel, Jon L via J3
Sent: Wednesday, May 8, 2019 1:01 AM
To: General J3 interest list <j3 at mailman.j3-fortran.org>
Cc: Steidel, Jon L <jon.l.steidel at intel.com>; Malcolm Cohen <malcolm at nag-j.co.jp>
Subject: Re: [J3] FORM TEAM statement NEW_INDEX= specifier & failed images
Malcom said:
This cannot happen. A failed image does not participate in program execution so cannot specify a team number.
Say we have 10 images, and NEW_IMAGE=THIS_IMAGE(), and we are creating a single team of 10 images (just for simplicity sake). On the new team, each image will have the same image index as on the parent team. Prior to executing the FORM TEAM statement, image 8 fails. Nine images then execute the FORM TEAM statement. Image number 9 and 10 will be assigned the image indices 9 and 10, respectively.
If the implementation checks for out of range image indices in a FORM TEAM statement, image 10 may detect that its NEW_INDEX is out of range, and if STAT= is not specified, image termination may be initiated (depending if the implementation views this as a fatal error). If STAT= is specified, by the rules of 11.6.11 p5, stat-var would be assigned a positive value different from STAT_STOPPED_IMAGE and STAT_FAILED_IMAGE.
If the implementation does not detect out of range image indices, and if STAT= is specified and no other error condition is detected, stat-var would then be assigned the value STAT_FAILED_IMAGE.
-jon
From: J3 [mailto:j3-bounces at mailman.j3-fortran.org] On Behalf Of Malcolm Cohen via J3
Sent: Monday, May 6, 2019 8:55 PM
To: 'General J3 interest list' <j3 at mailman.j3-fortran.org <mailto:j3 at mailman.j3-fortran.org> >
Cc: Malcolm Cohen <malcolm at nag-j.co.jp <mailto:malcolm at nag-j.co.jp> >
Subject: Re: [J3] FORM TEAM statement NEW_INDEX= specifier & failed images
<<<
What happens in the case where an image specifies both NEW_INDEX= and
STAT= in a FORM TEAM statement, and the image index specified for
NEW_INDEX= turns out to be greater than the number of images in the
new team due to image failure during the execution of FORM TEAM?
>>>
This cannot happen. A failed image does not participate in program execution so cannot specify a team number.
FORM TEAM is not a multi-step operation with exposed internal failure modes, so either the effect is as if the image failed “immediately before FORM TEAM” (in which case STAT_FAILED_IMAGE is returned, and the NEW_INDEX= values must match the number of active images in the new team), or the effect is as if the image failed “immediately after FORM TEAM”, in which case there is no error (STAT==0), it’s just that some of the images in the new team failed very quickly afterwards.
This is not terribly explicit, but I don’t see any other way to interpret the text that’s actually there. For there to be weird effects with exposed internal failure modes *we’d have to have allowed that* and we did not.
Cheers,
--
..............Malcolm Cohen, NAG Oxford/Tokyo.
Disclaimer
The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. Please see our Privacy Notice <https://www.nag.co.uk/content/privacy-notice> for information on how we process personal data and for details of how to stop or limit communications from us.
This e-mail has been scanned for all viruses and malware, and may have been automatically archived by Mimecast Ltd, an innovator in Software as a Service (SaaS) for business.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20190508/c18d779d/attachment-0001.html>
More information about the J3
mailing list