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

Van Snyder Van.Snyder
Thu Jan 22 21:13:26 UTC 2009


On Thu, 2009-01-22 at 02:06 -0800, N.M. Maclaren wrote:
> 
> >Does the problem arise because the buffer doesn't appear as an actual
> >argument in the call to the MPI wait routine, or is there another cause
> >for it?
> 
> There is another, more important, reason.
> 
> It is critical that the buffer is not moved or accessed by copy-in/copy-out
> between the initiation of the transfer and the wait.  The first could apply
> with a compacting garbage collector, for example.  The second is not JUST
> explicit argument passing, but includes compiler-generated procedure calls
> and (as I said) even open code in some implementations.
> 
> That is why a buffer and all 'active' associated entities must be marked as
> ASYNCHRONOUS or equivalent for the whole of that period.

Yes, that's what the ASYNCHRONOUS attribute is for, but if a variable
with the ASYNCHRONOUS attribute doesn't appear, the compiler can't know
not to do something in a context where it might nonetheless be affected
in the ways you describe.

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

Fortran understands the semantics of its WAIT statement, but doesn't
understand the semantics of the MPI wait procedure or MPI handles.  It
can't know that it shouldn't fiddle with the buffer if it or a subobject
of it doesn't appear.  If its address is hiding inside of an MPI handle,
there's no way Fortran will know that.

> >One simple step toward solving the problem is to write an extra
> >interface layer that includes the argument, which then calls the real
> >MPI wait routine, not passing that argument.  Then declaring the buffer
> >and the dummy argument of the wait routine interface layer to be
> >ASYNCHRONOUS ought to work, according to the rules we already have in
> >place for Fortran asynchronous I/O.
> 
> That is the solution which I thought about some time ago, and came to the
> conclusion "don't start from here".

That's too vague to draw any conclusions.  So far, in all my
consideration of this matter, it seems to be the only solution that
works, without enormous amounts of magic that would probably violate
Resolution T7.

-- 
Van Snyder                    |  What fraction of Americans believe 
Van.Snyder at jpl.nasa.gov       |  Wrestling is real and NASA is fake?
Any alleged opinions are my own and have not been approved or
disapproved by JPL, CalTech, NASA, the President, or anybody else.




More information about the J3 mailing list