(j3.2006) More "does synchronization occur?"

Malcolm Cohen malcolm
Wed Oct 8 05:18:00 EDT 2014

Van Snyder writes:]
>Subclause 8.5.1 has a list of image control statements.

Image control statements are to do with segment boundaries.  They don't 
necessarily do synchronisation themselves: some do, some don't. 
Processor-dependent synchronisation can occur without image control statements 
(though you will need to split the segments at some point to get the benefit of 
that synchronisation).

> says execution of a DEALLOCATE statement in which an
><allocate-object> is a coarray causes synchronization.
> 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

Once again, 8.5.1 is about image control statements, not about synchronisation.

> 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?

I don't think so - the text here requires execution of the same statement a 
number of times, and it is one execution of the statement that causes one or 
more deallocations, so it is one synchronisation.  Not that you can tell how 
many syncs there are (protocol might require multiple handshakes - syncs are 
fun!).  It might be clearer if we said straight-out that a single statement that 
causes the deallocation of multiple coarrays causes only a single 

>How about function results that have
>coarray components?  According to they're deallocated before
>the function is invoked.

That is not what p5 says at all - it is about specification functions.  And they 
cannot have allocated coarrays because they are required to be pure and pure 
functions cannot contain image control statements.  (Here is another good reason 
for not lifting the requirement on specification functions to be pure.)

>There are multiple descriptions of synchronization.  They're not


>  Aside from specifying the statement under discussion, should
>they be?


Some synchronisations are required to be executions of the same statement. 
Other synchronisations perform a nonspecific sync (e.g. SYNC ALL, SYNC IMAGES). 
And there may be processor-dependent synchronisation methods.

Perhaps there is additional structure we could add, but at least some of the 
differences are deliberate so we can't replace the whole thing with a single 
sync method (we'd need at least a "statement sync", a "general sync" and a 
"processor-dependent sync").  It does not look like there is a lot to gain here.

................................Malcolm Cohen, Nihon NAG, Tokyo. 

More information about the J3 mailing list