[MPI3 Fortran] [Interop-tr] [Mpi-forum] Comment on Fortran WG5 ballot N1846

Van Snyder Van.Snyder at jpl.nasa.gov
Tue Apr 19 15:35:53 CDT 2011

On Thu, 2011-04-14 at 13:03 -0700, Rolf Rabenseifner wrote:
> With
> CALL MPI_Irecv(buf, rq)
> CALL MPI_Wait(rq)
> xnew=buf
> The content of MPI_F_SYNC_REG is outside the scope of the
> Fortran optimization.
> I do not see that the compiler is allowed to move 
> "xnew=buf" before the MPI_Wait statement because
> "MPI_F_SYNC_REG(buf)" may have modified the content of buf.
> Therefore the problem is solved.
> Correct?
> If not, please can you show a detailed code, how 
> such a compiled code could work and in xnew is at the end
> ***not*** the value that was stored in buf by MPI_Wait.

If this works, why not change the Fortran -> MPI interface for MPI_Wait
to include "buf" instead of attaching the TARGET attribute to "buf" and
hoping the processor will guess that implies that a pointer to "buf"
might be hiding in "rq"?  After all, the processor can see "rq" and its
type (which might actually be TYPE(*)?), so it might (reasonably)
conclude from its analysis that "rq" doesn't contain any pointers to

More information about the mpiwg-fortran mailing list