[MPI3 Fortran] MPI non-blocking transfers

Bill Long longb at cray.com
Wed Jan 21 16:15:27 CST 2009

N.M. Maclaren wrote:
> Firstly, it can happen in plain code, and at least some compilers do (or
> used to).  For example, consider vectorisable loops on possibly
> non-contiguous or vector indexed arrays.  A compiler is perfectly
> entitled to copy more than it needs to contiguous workspace and copy
> both the updated and untouched locations back, if the array is not
> marked ASYNCHRONOUS and is not otherwise used.  The reason is typically
> alignment (as in many vector systems, SSE etc.)

I assume the memory involved is the MPI buffer array.  If the user has 
vectorizable code that references the array, and the processor hardware 
cannot handle non-stride-1 vectors, then it might make a copy. (More 
likely it would just load the upper and lower halves of the vector 
register with separate instructions, but for the sake of argument, 
suppose not.)  But it certainly would not do a copy back, since that 
data was never modified.   If the code is storing into the buffer array, 
which would require the copy back, then this is certainly a user error.  
The user is not allowed to write code the clobbers the buffer between 
initiation and completion of the MPI operation.
> Secondly, merely passing an argument does not count as a modification,
> even if it passes an array section to an assumed-size dummy (which
> forces copy-in/copy-out).  

Right, it does not count as a modification.  That is exactly why this is 
the problem that we have to solve.  It is not covered by the 'thou shall 
not clobber' rule imposed on the user.

> This can apply both if the call is an
> extraneous one, and when the call is an intermediate level between
> where the buffer is defined and the MPI call.

Agreed.  But this is also the case for asynchronous variables in 
Fortran.  So we do have some guidance on how proscribe coding 
requirements on the user. (Assuming it is allowed to force changes to 
existing codes.)


Bill Long                                   longb at cray.com
Fortran Technical Support    &              voice: 651-605-9024
Bioinformatics Software Development         fax:   651-605-9142
Cray Inc., 1340 Mendota Heights Rd., Mendota Heights, MN, 55120


More information about the mpiwg-fortran mailing list