libgfortran: Fix STAT= for stopped images in caf_shmem
Ensures Fortran coarray image control statements correctly report the status of stopped images.
This commit rectifies issues in the caf_shmem implementation of Fortran’s coarray features, specifically concerning the handling of stopped images. Image control statements like SYNC ALL and SYNC TEAM, as well as collective subroutines, now correctly report STAT=STAT_STOPPED_IMAGE or STAT=STAT_FAILED_IMAGE when a team contains a terminated image, adhering to the F2023 standard. Previously, these operations could deadlock or block indefinitely.
In Details
This set of changes for libgfortran's Coarray Fortran (CAF) shared memory implementation (caf_shmem) addresses deviations from the F2023 standard regarding terminated images. Previously, SYNC ALL and SYNC TEAM would synchronize remaining images, potentially leading to deadlocks. Collective subroutines blocked indefinitely. The fix involves marking barriers as 'aborting' for stopped images, aborting synchronizations, and having collectives report STAT_STOPPED_IMAGE or STAT_FAILED_IMAGE when a team includes a terminated image. The classification of STAT= has also been corrected to b…
- Coarray Fortran (CAF)
- An extension to the Fortran language that provides parallel programming capabilities through a syntax for accessing components of distributed memory arrays (called 'corray' components) on other images (processes).
- image
- In Coarray Fortran, an image represents an independent unit of execution, typically a process or thread, that can communicate with other images.
- SYNC ALL / SYNC TEAM
- Coarray Fortran synchronization primitives. SYNC ALL synchronizes all images in the current team, while SYNC TEAM synchronizes images within a specified team.
- F2023
- The Fortran 2023 standard, the latest revision of the Fortran programming language standard, which includes updates to coarray features.
- STAT=
- A Fortran statement specifier used in collective subroutines and synchronization operations to provide a status code, indicating success or the type of error that occurred.