To: J3 J3/18-180r1 From: R. Bader Subject: Ballot Comment JP 023 and JP 024 Date: 2018-June-12 Ballot Comment -------------- In their DIS Ballot for draft N2146 of Fortran 2018, the JP comment 024 reads: A CRITICAL statement seems to virtually include the effect of executing a SYNC MEMORY statement for the following reasons. In the case that image M executes a CRITICAL construct, image M shall not commence any memory operation in the segment corresponding to the CRITICAL construct before image M executes the CRITICAL statement. According to the fifth sentence of paragraph 3 in clause 11.1.6 (p. 187, line 26) , "Otherwise, if image M completes execution of the construct by failing, and image T is the next to execute the construct, the previous segment on image M precedes the segment on image T." This sentence means that a processor practically has to make all memory operations in the segments before the CRITICAL statement on image M precede any memory operation in the segment corresponding to the CRITICAL construct on image M, because when an image fails is generally unpredictable in advance and it will be impossible to complete delayed memory operations by a failed image in general. Therefore, a processor shall virtually ensure the order of memory operations before and after a CRITICAL statement by the image that executes the CRITICAL statement. This means that a CRITICAL statement virtually includes the effect of executing a SYNC MEMORY statement. with the suggested edit: Delete "CRITICAL" from the sentence "All image control statements except CRITICAL, END CRITICAL, EVENT POST, EVENT WAIT, FORM TEAM, LOCK, and UNLOCK include the effect of executing a SYNC MEMORY statement (11.6.5).". Discussion ---------- The current wording of 11.6.1 para 3 is not sufficiently clear. The intent of that paragraph was to limit the effect of the synchronization to only the segments that should be ordered against each other. The description of how segments are ordered are unambiguously provided for each image control statement. Therefore, 11.6.1 para 3 should not be needed, provided that the general description of the effects of segment ordering in 11.6.2 is complete. To achieve this, we have decided to revisit the JP041 comment from the last CD, adding text to assure that memory operations for inter-image ordering are appropriately implied (as a requirement on the implementation). The edits suggested below also resolve comment JP 023. Edit to N2146 ------------- In section "11.6.1 Image control statements" delete paragraph 3 "All image control statements except CRITICAL, END CRITICAL, EVENT POST, EVENT WAIT, FORM TEAM, LOCK, and UNLOCK include the effect of executing a SYNC MEMORY statement (11.6.5)." In section "11.6.2 Segments", before NOTE 11.35, add a new paragraph 4: "If, by execution of a statement in segment P_i on image P, * a variable X is defined, referenced, becomes undefined, or has its allocation status, pointer association status, array bounds, dynamic type, or type parameters changed or inquired about, * segment P_i on image P precedes segment Q_j on image Q, and * X is defined, referenced, becomes undefined, or has its allocation status, pointer association status, array bounds, dynamic type, or type parameters changed or inquired about by execution of a statement in segment Q_j on image Q, then the action regarding X in segment P_i on image P precedes the action regarding X in segment Q_j on image Q."