[Mpi-comments] MPI 4.0 and Fortran about the Problem with Code Movement and MPI_F_SYNC_REG (section 19.1.17)

Dimitri Lecas dimitri.lecas at idris.fr
Thu Aug 19 04:07:17 CDT 2021


Hello,

I 've a question about the use of MPI_F_SYNC_REG to avoid optimisation 
problem.

If I understand well a way to avoid  change in order is to use 
MPI_F_SYNC_REG after the wait like this :


   call MPI_ISEND(buf,...,req)
   ! some work
   call MPI_WAIT(req,...)
   if (.not. MPI_ASYNC_PROTECTS_NONBLOCKING) call MPI_F_SYNC_REG(buf)
   buf = val2


My question is what in this solution prevent the compiler to put the 
"call MPI_WAIT" after the line "buf = val2" ?


Regards



More information about the mpi-comments mailing list