To: J3 J3/25-125 From: D. Bonachea & HPC Subject: F202Y feature request: collectives over a specified team Date: 2025-February-18 References: 22-163: F202Y feature request - extend collective semantics WG5-N2234: WORK ITEMS FROM THE HYBRID WG5 MEETING Formal Requirement (from 22-163, lightly edited) ~~~~~~~~~~~~~~~~~~ The collective subroutines of Fortran should support execution in a specified team that is not the current team. Background ---------- As of Fortran 2023, the collective subroutine intrinsics (CO_BROADCAST, CO_MAX, CO_MIN, CO_REDUCE, and CO_SUM) may only be executed over the current team, as defined by the CHANGE TEAM construct. This becomes very awkward when one needs to execute such a collective over an ancestor team; because there is no way to directly express that without closing the CHANGE TEAM construct, and invoking END TEAM may have undesired side-effects such as deallocating team-specific coarrays. It would also be convenient to allow collectives directly over a child team without forcing the synchronization side effects associated with a CHANGE TEAM to that child team. Collective subroutines are not image control statements, and they are entirely decoupled from the coarray feature that motivates the design of CHANGE TEAM and the current team stack. There is no fundamental reason to disallow execution of a collective subroutine over any named team, provided of course that all the members of that specified team execute the same collective subroutine statement together. The SYNC TEAM statement allows synchronization over any specified ancestor team or child team passed as a TEAM_TYPE argument, which is analogous to the feature proposed here except for data exchange instead of synchronization. Team collective operations have been a standard part of MPI for decades. Every MPI collective operation takes a communicator argument that names the team of processes participating in that collective. HPC programmers familiar with subset teams expect this feature as a natural capability, and are disappointed to find it currently missing from Fortran's multi-image feature set. Status ------ WG5-N2234 added this to the "CONDITIONALLY ACCEPTED" work list as Item DIN1: - DIN1 Add execution of collective procedures on a specified team Ref: N2230 "DIN Suggestions for F202Y" The full formal requirement, specification and set of suggested edits are detailed in 22-163 as originally proposed by R. Bader. In summary, these add an optional TEAM argument of type TEAM_TYPE to the five collective subroutines and specifies that execution of the subroutine applies for the specified team if the argument is present (or the current team if absent, preserving backwards compatibility). The contents of 22-163 are believed to remain complete and correct, and should be advanced as written there.