-
Notifications
You must be signed in to change notification settings - Fork 932
Closed
Description
The intent of the receive buffer is declared incorrectly as intent(in) in all MPI_All* routines in the mpi-f08 module on the master branch of version 3.1. According to version 3.1 of the MPI standard (appendix A.3.3), the intent of the receive buffers should be intent(inout) (default). Note that the intent of the receive buffer in MPI_Recv is set according to the standard.
If the receive buffer is of intent(in), the compiler is free to optimize the routine in illegal ways.
For example, the compiler is allowed to interchange the following two calls:
call MPI_Alltoall(sndbuf,100,MPI_INT,recvbuf,100,MPI_INT,MPI_COMM_WORLD)
call MPI_Allreduce(sndbuf,recvbuf,1,MPI_INT,MPI_MAX,MPI_COMM_WORLD)into:
call MPI_Allreduce(sndbuf,recvbuf,1,MPI_INT,MPI_MAX,MPI_COMM_WORLD)
call MPI_Alltoall(sndbuf,100,MPI_INT,recvbuf,100,MPI_INT,MPI_COMM_WORLD)The problem could easily be fixed by setting the intent of recvbuf in all MPI_All* routines to intent(inout).