GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc/libgfortran

libgfortran: Assign unique IDs to teams in caf_shmem for PR127738

Fixes team ID collisions in libgfortran's caf_shmem by assigning unique IDs.

This change addresses PR127738 by ensuring that each team in libgfortran’s caf_shmem module receives a unique identifier. Previously, team IDs were derived from team numbers and the count of FORM TEAM statements, leading to collisions and inconsistencies across different images of the same team. The fix introduces a supervisor-managed counter for team IDs, ensuring correct identification and enabling proper coarray ID derivation.

In Details

The caf_shmem implementation in libgfortran uses a supervisor process to manage coarray teams. This commit fixes a bug where team IDs were not unique, causing issues with coarray operations. The fix involves introducing a per-team ID counter in the supervisor and correctly deriving coarray IDs from the team's unique identifier.

For Context
libgfortran
The runtime library for the GNU Fortran compiler (gfortran). It provides support for Fortran language features, including coarray parallel programming.
caf_shmem
A component within libgfortran that implements Fortran's Coarray API using shared memory for communication.
Coarray API
A Fortran language feature for parallel programming, allowing processes (images) to directly access data in other processes (coarrays).
FORM TEAM
A Fortran statement used to create a new team of images for coarray execution.
image
In the context of Fortran coarrays, an image represents an independent process or thread participating in parallel execution.
Filed Under: libgfortrancoarraysparallelismbugfix