parallel processing - Will MPI_Send block if matching MPI_IRecv takes less data elements? -
assume following mpi code.
mpi_comm_rank(mpi_comm_world, &rank); if (rank == 0){ mpi_send(a, count, mpi_char, 1, 0, mpi_comm_world); mpi_send(b, count, mpi_char, 1, 0, mpi_comm_world); } else if (rank == 1){ mpi_irecv(a, 1, mpi_char, 0, 0, mpi_comm_world, &req); mpi_recv(b, count, mpi_char, 0, 0, mpi_comm_world); mpi_wait(&req, &status); }
is correct the first mpi_send(a, count, ...)
not block though matching mpi_irecv(a, 1, ...)
reading 1 element buffer?
also, since no reads/writes done buffer a
, correct process 1 not block though mpi_wait
not called directly after mpi_irecv
?
thanks.
mpi_send block...it blocking call. "blocking" call return when send/recv buffer can safely read/modified calling application. no guarantees made matching mpi_[i]recv call.
the mpi library not know read/write status of buffers in application. mpi standard calls guarantees made application stability of message buffers.
Comments
Post a Comment