To: J3 J3/25-166 Subject: US04: Syntax for Asynchronous Collective Subroutines From: Brandon Cook & Damian Rouson & Dan Bonachea & Reuben D. Budiardja Date: 2025-September-12 References: J3/25-162r1, J3/25-165, J3/25-127r1, WG5/N2249 1. Background ------------- The current Fortran 202Y work list WG5/N2249 includes asynchronous collective subroutines as accepted work item US04. Paper J3/25-162r1 "US04: Requirements for Asynchronous Collective Subroutines" presents an illustrative use case and a list of requirements. Paper J3/25-165 "US04: Specifications for Asynchronous Collective Subroutines" presents the proposed specifications and semantics for the new asynchronous collective subroutines feature. Please consult that paper for all semantic details, which will not be replicated here. The current paper focuses exclusively on the proposed syntactic elements for the asynchronous collective subroutines feature. 2. Completion Type Syntax ------------------------- T1. New type COMPLETION_TYPE is added to the ISO_FORTRAN_ENV intrinsic module. See J3/25-165 for detailed specifications and semantics. 3. Asynchronous Collective Initiation Syntax -------------------------------------------- An optional COMPLETION argument of type COMPLETION_TYPE is added as the final argument to each of the five collective subroutines, yielding the following: C1. CO_BROADCAST (A, SOURCE_IMAGE [, STAT, ERRMSG, COMPLETION]) C2. CO_MAX (A [, RESULT_IMAGE, STAT, ERRMSG, COMPLETION]) C3. CO_MIN (A [, RESULT_IMAGE, STAT, ERRMSG, COMPLETION]) C4. CO_REDUCE (A, OPERATION [, RESULT_IMAGE, STAT, ERRMSG, COMPLETION]) C5. CO_SUM (A [, RESULT_IMAGE, STAT, ERRMSG, COMPLETION]) See J3/25-165 for detailed specifications and semantics. Note that J3/25-127r1 "DIN1: Collectives over a specified team, req/spec/syntax/edits" also adds a different trailing optional argument (TEAM) to each of the collective subroutines above, for work item DIN1. These two features (US04 and DIN1) are entirely orthogonal, and their corresponding new arguments could be specified in either order. C6. Assuming that edits for both work items DIN1 and US04 are applied for Fortran 202Y, we propose that the new optional TEAM argument immediately precede the new optional COMPLETION argument in the syntax of each collective subroutine listed above. 4. Completion Wait Statement Syntax ----------------------------------- A new called COMPLETION WAIT is introduced, with the following syntax: W1. <> COMPLETION WAIT ( ) W2. <> W3. The specifier to COMPLETION WAIT shall be a variable of type COMPLETION_TYPE from the intrinsic module ISO_FORTRAN_ENV. W4. The COMPLETION WAIT statement contains no specifiers other than the . See J3/25-165 for detailed specifications and semantics. 5. Completion Query Function Syntax ----------------------------------- A new standard intrinsic elemental function called COMPLETION_QUERY is introduced, with the following syntax: Q1. COMPLETION_QUERY ( COMPLETION ) Q1. The COMPLETION argument to COMPLETION_QUERY() shall be a variable of type COMPLETION_TYPE from the intrinsic module ISO_FORTRAN_ENV. Q3. The COMPLETION_QUERY function accepts no arguments other than the completion variable. See J3/25-165 for detailed specifications and semantics. ===END===