libgfortran: Terminate all images on ERROR STOP in caf_shmem
Ensures ERROR STOP in Fortran coarrays terminates all participating images, preventing deadlocks.
This change modifies the Fortran coarray shared memory implementation to correctly handle ERROR STOP statements. Previously, an ERROR STOP on one image would cause other images to block indefinitely on subsequent synchronization operations. Now, ERROR STOP correctly initiates error termination across all images in the team, preventing deadlocks and ensuring consistent program termination behavior.
In Details
This commit updates libgfortran's caf_shmem to align with F2023's ERROR STOP semantics. An ERROR STOP statement now triggers a coordinated error termination of all images within a team. Previously, only the image executing ERROR STOP terminated, leaving others blocked. The implementation records the error state before exiting and the supervisor is responsible for terminating the remaining images. This ensures that all images participate in the error termination, preventing potential deadlocks.
- 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).
- ERROR STOP
- A Fortran statement that initiates abnormal termination of the program, typically indicating a runtime error.
- image
- In Coarray Fortran, an image represents an independent unit of execution, typically a process or thread, that can communicate with other images.
- supervisor
- In a distributed or parallel system, a process or component responsible for managing and coordinating other worker processes or images. In this context, it manages coarray image termination.