Block construct and sync all behavior

Tobias Burnus burnus@net-b.de
Tue Oct 21 05:49:00 GMT 2014


Hi Damian,

Damian Rouson wrote:
> The program and output below seem to show that the "sync all” is not serving as a barrier.  I would have expected that b oth “Now image…” lines would appear at the end of the output.  If however, I uncomment the shown “block” and “end block”, I get the behavior I expected.  Is this behavior correct?  Does it relate in some way to buffering?

You have to consult the documentation of your MPI implementation (or of 
GASNet) regarding the handling of I/O. "SYNC ALL" just synchronizes the 
the code part. However, most MPI do not provide any ordering for I/O on 
different images. (They might have a flag for this.)

With your implementation, it looks as if it fully caches the output on 
the remote image and then sends it, given that the output is not mixed 
at all.

With Open MPI, you could try --timestamp-output, assuming that the 
timestamp is added on each image and that the time is well synchronized.

The BLOCK shouldn't have any synchronization effect* and should generate 
identical code if you don't declare variables in the block. (* except 
you declare and allocate a coarray in the block, which then will be 
collectively deallocated at the end of the scope.)

For simple programs, you can also try: -fdump-tree-original and look at 
the generated code, in particular search for _gfortran_caf_*.

Tobias



More information about the Fortran mailing list