libgfortran: Report terminated images in coarray collectives with STAT
Fixes coarray collective subroutines to report terminated images using STAT argument as per F2023 standard.
This commit modifies libgfortran’s coarray collective subroutines to correctly report terminated images during collective operations. Previously, if an image in a team terminated, collective subroutines would report a runtime error and terminate remaining images, even if a STAT argument was present. Now, in compliance with the F2023 standard, it assigns STAT_STOPPED_IMAGE or STAT_FAILED_IMAGE to the STAT argument when an image terminates, allowing other images to continue if STAT is provided.
In Details
Collective subroutines (_gfortran_caf_co_broadcast, _gfortran_caf_co_sum, etc.) in libgfortran now correctly handle terminated images in a team. Previously, an abandoned barrier due to an image termination would cause the collective to error-terminate all images. This change aligns with F2023 16.6 by passing the terminated image status (via STAT_STOPPED_IMAGE or STAT_FAILED_IMAGE) up to the collective and classifying it as an image control statement would, allowing the STAT argument to capture the error without necessarily terminating the entire team.
- libgfortran
- The runtime library for the GNU Fortran compiler, providing support for language features and intrinsic procedures.
- coarray
- A Fortran feature that allows for parallel programming by providing a syntax for declaring data that is accessible across different images (processes or threads).
- collective subroutine
- A type of coarray subroutine (e.g.,
co_broadcast,co_sum) that performs an operation involving all images in a team. - image
- In Fortran coarray programming, an individual processing unit or context that can execute concurrently with others in a team.
- STAT
- An optional argument in Fortran coarray statements that receives status information about the operation, such as whether an image has terminated.