From: Christian Heinrich Date: Wed, 24 Jan 2018 13:28:11 +0000 (+0100) Subject: [SMPI] Fix wrong usage of request->src() and dst() with ranks X-Git-Tag: v3.19~312^2~2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/38d23cf285f4191805df2b94a01636d23395c291 [SMPI] Fix wrong usage of request->src() and dst() with ranks We need to use the process id instead of the local rank, so let's do that. --- diff --git a/src/smpi/mpi/smpi_win.cpp b/src/smpi/mpi/smpi_win.cpp index 5a2544d586..26d6da8a35 100644 --- a/src/smpi/mpi/smpi_win.cpp +++ b/src/smpi/mpi/smpi_win.cpp @@ -693,8 +693,13 @@ int Win::finish_comms(int rank){ size = 0; std::vector myreqqs; std::vector::iterator iter = reqqs->begin(); + int proc_id = comm_->group()->actor(rank)->getPid(); while (iter != reqqs->end()){ - if(((*iter)!=MPI_REQUEST_NULL) && (((*iter)->src() == rank) || ((*iter)->dst() == rank))){ + // Let's see if we're either the destination or the sender of this request + // because we only wait for requests that we are responsible for. + // Also use the process id here since the request itself returns from src() + // and dst() the process id, NOT the rank (which only exists in the context of a communicator). + if (((*iter) != MPI_REQUEST_NULL) && (((*iter)->src() == proc_id) || ((*iter)->dst() == proc_id))) { myreqqs.push_back(*iter); iter = reqqs->erase(iter); size++;