<div dir="ltr">Hi,<div><br></div><div style>I have a question about the semantics of non-blocking collective communication. For example, let's consider MPI_Ibarrier. The MPI 3.0 standard specifies that:</div><div style>
<br></div><div style>"MPI_IBARRIER is a nonblocking version of MPI_BARRIER. By calling MPI_IBARRIER, a process notifies that it has reached the barrier. The call returns immediately, indepen- dent of whether other processes have called MPI_IBARRIER. The usual barrier semantics are enforced at the corresponding completion operation (test or wait), which in the intra- communicator case will complete only after all other processes in the communicator have called MPI_IBARRIER. In the intercommunicator case, it will complete when all processes in the remote group have called MPI_IBARRIER."</div>
<div style><br></div><div style>My understanding of the standard is that that MPI_Wait(&request, &status), where request has been previously passed into MPI_Ibarrier, returns after all processes in the respective intra-communicator called MPI_Ibarrier. However, the mpich-3.0.4 library, seems to in some cases wait for all processes in the respective intra-communicator to call MPI_Wait. Here is an example that demonstrates this behavior:</div>
<div style><br></div><div style><div>#include <mpi.h></div><div>#include <unistd.h></div><div><br></div><div>int main( int argc, char *argv[]) {</div><div>  MPI_Request request;</div><div>  MPI_Status status;</div>
<div>  MPI_Init(&argc, &argv );</div><div>  int myrank;</div><div>  MPI_Comm_rank(MPI_COMM_WORLD, &myrank);</div><div>  if (myrank == 0) {</div><div>    MPI_Ibarrier(MPI_COMM_WORLD, &request);</div><div>    MPI_Wait(&request, &status);</div>
<div style>    printf("%d, Completed barrier.\n", myrank);<br></div><div>  } else {</div><div>    MPI_Ibarrier(MPI_COMM_WORLD, &request);<br></div><div>    sleep(1);</div><div>    MPI_Wait(&request, &status);</div>
<div>    printf("%d, Completed barrier.\n", myrank);</div><div>  }</div><div>  MPI_Finalize();</div><div>  return 0;</div><div>}</div><div><br></div><div style>When executed with "mpiexec -n 2 ./example", I see the expected output and timing. However, when executed with "mpiexec -n 3 ./example", the call to MPI_Wait in process 0 returns only after the other processes wake up from sleep() and call MPI_Wait. </div>
<div style><br></div><div style>Isn't this a violation of the standard?</div><div style><br></div><div style>Best,</div><div style><br></div><div style>--Jiri Simsa</div><div style><div><br></div></div></div></div>