(j3.2006) BLOCK-type statement
Aleksandar Donev
donev1
Fri May 30 02:00:41 EDT 2008
Hi,
A couple of comments concerning Dick's suggestion that a statement that
acts as a barrier to code motion could be used for handling user-defined
asynchronous I/O such as MPI's non-blocking communication.
First, we already have such a statement in the language for co-arrays,
SYNC MEMORY, for pretty much exactly the same reason (the asynchronous
modifications are due to other images). In principle, I don't see why
SYNC MEMORY barriers could not be applied to non co-arrays as well,
especially if we give them some attribute to distinguish them or amend
an existing attribute. For example, why not say that
references/definitions to variables with the ASYNCHRONOUS attribute
cannot be moved across SYNC MEMORY (a good way to formally state that is
to use our segment-ordering model)? This way, the attribute implicitly
also applies to user-defined I/O. There is no reason that the attribute
has to exclusively apply to Fortran I/O.
Now, note that in practice, when they implement co-arrays (:-) no
compiler is likely to move any statements across SYNC MEMORY lines. But,
I believe we need to carefully specify the permissions and boundaries
for optimization going well beyond what compilers may be capable or
incapable of today.
So what I am thinking of is:
REAL, ASYNCHRONOUS :: buffer(...)
CALL MPI_IRecv(buffer,...) ! The dummy buffer has the ASYNC attribute
... ! Code not involving buffer but buffer may be modified outside
CALL MPI_Wait(...)
SYNC MEMORY
Aleks
More information about the J3
mailing list