To: J3 J3/25-166r2 Subject: US04: Syntax for Asynchronous Collective Subroutines From: Brandon Cook & Damian Rouson & Dan Bonachea & Reuben D. Budiardja Date: 2025-October-23 References: J3/25-162r2, J3/25-165r1, J3/25-166r1, 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-162r2 "US04: Requirements for Asynchronous Collective Subroutines" presents an illustrative use case and a list of requirements. It passed at the Oct 2025 J3 meeting #237. Paper J3/25-165r1 "US04: Specifications for Asynchronous Collective Subroutines" presents the specifications and semantics for the new asynchronous collective subroutines feature. It passed at the Oct 2025 J3 meeting #237. 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. This revision of the paper incorporates J3 committee feedback provided in plenary discussion of revision J3/25-166r1 on 2025-10-22, and applies the results from a series of straw polls used to settle the syntax. 2. Completion Type Syntax ------------------------- T1. New type COMPLETION_TYPE is added to the ISO_FORTRAN_ENV intrinsic module. See J3/25-165r1 for detailed specifications and semantics. 3. Asynchronous Collective Initiation Syntax -------------------------------------------- Paper J3/25-127r1 "DIN1: Collectives over a specified team, req/spec/syntax/edits" (passed at Jun 2025 J3 meeting #236), adds a new TEAM argument to the same collective subroutines impacted by work item US04. The functionality of these two features (US04 and DIN1) is entirely orthogonal, but their effects must be merged in the final syntax. For clarity of direction, this paper incorporates the syntactic changes from work item DIN1, and supersedes the syntax presented in section 4 of J3/25-127r1. A forthcoming edit paper is also expected to supersede the edits passed in section 5 of J3/25-127r1. Each of the collective subroutines are expanded into four forms, corresponding to the appearance or non-appearance of a COMPLETION argument of type COMPLETION_TYPE and a TEAM argument of type TEAM_TYPE (also from intrinsic module ISO_FORTRAN_ENV). The full syntax for all forms of the updated collective subroutines is as follows. The first form of each intrinsic corresponds to the unmodified current intrinsic interface. C1. CO_BROADCAST (A, SOURCE_IMAGE [, STAT, ERRMSG]) or CO_BROADCAST (A, SOURCE_IMAGE, COMPLETION [, STAT, ERRMSG]) or CO_BROADCAST (A, SOURCE_IMAGE, TEAM [, STAT, ERRMSG]) or CO_BROADCAST (A, SOURCE_IMAGE, TEAM, COMPLETION [, STAT, ERRMSG]) C2. CO_MAX (A [, RESULT_IMAGE, STAT, ERRMSG]) or CO_MAX (A [, RESULT_IMAGE], COMPLETION [, STAT, ERRMSG]) or CO_MAX (A [, RESULT_IMAGE], TEAM [, STAT, ERRMSG]) or CO_MAX (A [, RESULT_IMAGE], TEAM, COMPLETION [, STAT, ERRMSG]) C3. CO_MIN (A [, RESULT_IMAGE, STAT, ERRMSG]) or CO_MIN (A [, RESULT_IMAGE], COMPLETION [, STAT, ERRMSG]) or CO_MIN (A [, RESULT_IMAGE], TEAM [, STAT, ERRMSG]) or CO_MIN (A [, RESULT_IMAGE], TEAM, COMPLETION [, STAT, ERRMSG]) C4. CO_REDUCE (A, OPERATION [, RESULT_IMAGE, STAT, ERRMSG]) or CO_REDUCE (A, OPERATION [, RESULT_IMAGE], COMPLETION [, STAT, ERRMSG]) or CO_REDUCE (A, OPERATION [, RESULT_IMAGE], TEAM [, STAT, ERRMSG]) or CO_REDUCE (A, OPERATION [, RESULT_IMAGE], TEAM, COMPLETION [, STAT, ERRMSG]) C5. CO_SUM (A [, RESULT_IMAGE, STAT, ERRMSG]) or CO_SUM (A [, RESULT_IMAGE], COMPLETION [, STAT, ERRMSG]) or CO_SUM (A [, RESULT_IMAGE], TEAM [, STAT, ERRMSG]) or CO_SUM (A [, RESULT_IMAGE], TEAM, COMPLETION [, STAT, ERRMSG]) See J3/25-165r1 for detailed specifications and semantics; since that paper, the COMPLETION argument has been changed from an optional argument to a required argument with alternative intrinsic forms. However the same semantics apply, with "presence" or "absence" of the COMPLETION argument replaced with whether or not it appears in the call, respectively. 4. Completion Subroutine Syntax ------------------------------- A new standard intrinsic subroutine called COMPLETE is introduced, with the following syntax: W1. COMPLETE( COMPLETION [, FINISHED ]) W2. COMPLETION shall be a variable of type COMPLETION_TYPE from the intrinsic module ISO_FORTRAN_ENV. It shall not be coindexed. It is an INTENT(INOUT) argument. W3. FINISHED (optional) when present, shall be a variable of logical type with the same shape as COMPLETION. It is an INTENT(OUT) argument. See J3/25-165r1 for detailed specifications and semantics; the argument names have been modified since that paper, but the corresponding semantics remain unchanged. ===END===