(j3.2006) More "does synchronization occur?"
Tue Oct 7 20:56:07 EDT 2014
Subclause 8.5.1 has a list of image control statements. Subclause 8.5.2
describes segments. Subclause 8.5.3, and others, describe
synchronization as "execution of the segment following the XYZ statement
is delayed until each image has executed the same XYZ statement the same
number of times," with variations (compare 8.5.3 to 188.8.131.52p11).
A statement that completes execution of a block or procedure and which
results in implicit deallocation of a coarray is an image control
statement. An ALLOCATE or DEALLOCATE statement that has a coarray
<allocate-object> is an image control statement.
184.108.40.206p11 says execution of a DEALLOCATE statement in which an
<allocate-object> is a coarray causes synchronization.
220.127.116.11p10 says that automatic deallocation is the same as execution of
a DEALLOCATE statement without a <dealloc-opt-list>.
Does this mean that statements not listed in 8.5.1 but that cause
automatic deallocation, such as invoking a procedure that has an
allocatable INTENT(OUT) coarray argument, cause synchronization? What
if it has multiple such? Are they separately synchronized? If so, do
we need to guarantee they are synchronized in the same order on all
images (we apparently don't need that in the case of a DEALLOCATE
statement with multiple coarrays)? How about function results that have
coarray components? According to 18.104.22.168p5 they're deallocated before
the function is invoked. Intrinsic assignment involving a variable that
is an allocatable coarray or coindexed object, or that has an
allocatable coarray component, apparently cannot cause allocation or
There are multiple descriptions of synchronization. They're not
identical. Aside from specifying the statement under discussion, should
they be? If so, it would be better to have a subclause in 8.5, aptly
named "Synchronization," that describes it once and for all. It ought
to be before "Image Control Statements".
More information about the J3