[MPI3 Fortran] (j3.2006) (SC22WG5.3886) [ukfortran] [MPI3 Fortran] MPI non-blocking transfers

Bill Long longb at cray.com
Thu Jan 22 11:10:56 CST 2009

N.M. Maclaren wrote:
> On Jan 22 2009, Van Snyder wrote:
>> Assuming the problem is caused by the buffer not appearing as an actual
>> argument, it's not a defect in Fortran but rather in the design of MPI.
> If that were the whole problem, it would be.  It would also be a defect in
> the design for the Fortran WAIT statement.

Except that the WAIT statement does have at least some semantics that 
the compiler understands. Which raises an interesting point.  Nick has 
pointed out several places where it is theoretically possible for the 
compiler optimizer to cause problems because the "invisible hand" of the 
MPI runtime  currently "owns" part of the program's memory space and 
either expects it to remain static (sends) or modifies it (receives).   
Fortran already has an attribute designed exactly for this situation - 
VOLATILE.   VOLATILE and ASYNCHRONOUS normally appear together in the 
standard since they are so similar in effect.  The one difference (from 
the compiler's point of view) is that the volatility of a variable with 
the asynchronous attribute can be "turned off" when the compiler sees a 
global WAIT.    If we modify the ASYNCHRONOUS attribute to be used to 
solve the issues with MPI calls, then WAIT is no longer special, and 
VOLATILE and ASYNCHRONOUS become functionally identical.  That's one of 
the undesirable side effect that makes me dislike the idea of modifying 
ASYNCHRONOUS.  (The other is that it incorrectly suggests that MPI calls 
have something to do with I/O which is not the case (except for the 
actual MPI I/O calls).)  If we use a different name, like 
ASYNC_EXTERNAL, is there any difference between that and VOLATILE?  I 
suspect not.  In which case, the obvious solution is to just use 
VOLATILE.  (Which was the conclusion of the previous round of 
discussions on this topic.)  VOLATILE had a couple of very attractive 
features.  It requires zero changes in either the Fortran standard or in 
any compiler implementations.  Thus, it is an immediately available 
solution for the MPI group.  VOLATILE might be strong enough to solve 
the code-motion problem as well.


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