To: J3 J3/16-281r1 From: R. Bader & Jon Steidel Subject: specification of SYNC MEMORY Date: 2016 October 12 References: 16-007r2 Discussion: ~~~~~~~~~~~ The specification of the ordering properties of SYNC MEMORY described in 11.6.5 SYNC MEMORY statement, para 2 appear to be in contradiction to the explanatory text for the atomic subroutines appearing in Appendix C.12.2.2, in particular [596:21-25]. This seems to be related to at least a subset of the hen-and-egg problems brought up by Nick Maclaren. Edits are provided below based on the conclusion that atomic references and definitions should be excepted from the general ordering properties. Edits: ~~~~~~ {Original suggested edit to correct the contradiction} [209:6] and [210:3] 11.6.5 SYNC MEMORY statement replace "defined, referenced" by "nonatomically defined, nonatomically referenced", twice. {Additional minor edits needed when researching this issue} [592:3] C.11.1.2 Examples with atomic operations change "is is" to "is" {Duplicate "is"} [596:4] C.12.2.2 Examples with atomic operations change "Y [*] = 0" to "Y [*] = 0, TMP" {Declare variable TMP} [596:12] C.12.2.2 Examples with atomic operations : Example 1 change "tmp==1" to "TMP==1" {Make case of variable names consistent} [596:15] C.12.2.2 Examples with atomic operations : Example 1 change "tmp" to "TMP" {Make case of variable names consistent} Rejected edit: ~~~~~~~~~~~~~~~~ [210:6+]: 11.6.5 SYNC MEMORY statement p. 2 Add sentence "If P is the same image as Q, atomic definitions or references to X before the SYNC MEMORY precede atomic definitions or references to Y after the SYNC MEMORY statement." {this appears to be necessary to continue ensuring that such defs and refs are not moved across the SYNC MEMORY by the optimizer}. Discussion: This edit is incorrect. Section 11.6.2 [206:30-35] Segments states that a coarray may be referenced or defined by execution of an atomic subroutine during the execution of a segment that is unordered relative to the execution of a segment in which the coarray is referenced or defined by the execution of an atomic subroutine. This allows multiple ATOMIC_DEFINEs and/or ATOMIC_REFs of the same variable in unordered segments. Inclusion of this edit would force the ATOMIC_DEFINE of X to precede the ATOMIC_DEFINE of Y (both in image j) when the SYNC MEMORY is present between the ATOMIC_DEFINEs. This contradicts the point the example is trying to make in Example C.12.2.2.