Fortran 2008 Coarray Default Synchronization: Unresolved Implicit Sync Behavior
0 reputation · 25 Sept 2021, 02:26 UTC
Fortran 2008 Coarray Default Synchronization: Unresolved Implicit Sync Behavior
The primary goal is to understand how the lack of a defined implicit synchronization policy for coarray accesses affects the user‑facing workflow in modern Fortran compilers. The feature in question is the coarray syntax (e.g., real :: a[*]) introduced in Fortran 2008, which allows direct memory sharing across images without explicit MPI calls. However, the standard does not specify whether a reference to a coarray automatically triggers a synchronization barrier before reading or writing, or whether synchronization must be invoked explicitly with SYNC ALL or SYNC IMAGES.
Compilers currently differ: some perform an implicit barrier on each coarray reference, while others require explicit sync statements. This uncertainty introduces portability issues and can lead to subtle race conditions when code is ported between vendors. The user‑facing workflow therefore lacks a clear guideline on when to insert sync statements, impacting readability and maintainability.
Key questions remain:
- Does the Fortran 2008 standard mandate any implicit synchronization for coarray references, or is it entirely left to compiler implementation?
- What are the documented behaviors in major Fortran compilers (e.g., GNU, Intel, Fujitsu) regarding implicit sync for coarrays?
- How can developers reliably document and enforce synchronization semantics to ensure portability across these compilers?