(j3.2006) Fortran 2008 "ALL STOP" and exit status code
Wed Jan 30 12:28:59 EST 2008
Tobias Burnus wrote:
> From the Fortran 2008 draft standard:
> "Execution of a STOP statement initiates normal termination of
> execution. Execution of an ALL STOP statement initiates error
> termination of execution."
> NOTE 8.28: "If the stop-code is of type character or does not appear, or
> if an END PROGRAM statement
> is executed, it is recommended that the value zero be supplied as the
> process exit status, if the
> processor supports that concept."
> As "ALL STOP" initializes an "error termination" should one not then
> recommend to return a non-zero status for stop codes of the type character?
Maybe the word "error" is confusing here. The intention here is that
users would execute ALL STOP if they want to kill off all the images
because continuation is pointless. This could be because of bad input
data, algorithm convergence failure, or getting a failed status back
from an I/O statement or memory allocation. These cases may or may not
correspond to what one would expect to cause a non-zero exit status. We
should discuss your suggestion, but the issue may not be as simple as
you indicate. (I'd also note that your comment pertains to a Note,
which is not part of the normative text of the standard.)
> Additionally, it is not fully clear to me whether STOP and ALL STOP stop
> a single image or all images. "When an image is terminated by a STOP or
> ALL STOP statement" implies that it only stops a single image; however,
> "ALL STOP" implies by its name that all images are stopped.
STOP halts the execution of just that image. ALL STOP halts the
execution of its image and then causes the other images to halt
execution as well. You are getting the correct inference from the name
ALL STOP. The semantics here rely on the meanings of "normal
termination" and "error termination" which are covered in 2.4.5
"Execution sequence", paragraphs 5 and 6. Pages 33-34 in 08-007. In
particular, see the text at the top of page 34.
> J3 mailing list
> J3 at j3-fortran.org
Bill Long longb at cray.com
Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9142
Cray Inc., 1340 Mendota Heights Rd., Mendota Heights, MN, 55120
More information about the J3