From a9c69e7eb9a48f86f3784e72daacd326147f2465 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Fri, 10 May 2019 01:38:02 +0200 Subject: [PATCH] before matching message sent with MPI_ANY_SOURCE, check that sending process is valid in our local communicator. --- src/smpi/mpi/smpi_request.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/smpi/mpi/smpi_request.cpp b/src/smpi/mpi/smpi_request.cpp index 85a9497570..7af734bc02 100644 --- a/src/smpi/mpi/smpi_request.cpp +++ b/src/smpi/mpi/smpi_request.cpp @@ -119,7 +119,7 @@ int Request::match_recv(void* a, void* b, simgrid::kernel::activity::CommImpl*) xbt_assert(ref, "Cannot match recv against null reference"); xbt_assert(req, "Cannot match recv against null request"); - if((ref->src_ == MPI_ANY_SOURCE || req->src_ == ref->src_) + if(((ref->src_ == MPI_ANY_SOURCE && (ref->comm_->group()->rank(req->src_) != MPI_UNDEFINED)) || req->src_ == ref->src_) && ((ref->tag_ == MPI_ANY_TAG && req->tag_ >=0) || req->tag_ == ref->tag_)){ //we match, we can transfer some values if(ref->src_ == MPI_ANY_SOURCE) @@ -145,7 +145,7 @@ int Request::match_send(void* a, void* b, simgrid::kernel::activity::CommImpl*) xbt_assert(ref, "Cannot match send against null reference"); xbt_assert(req, "Cannot match send against null request"); - if((req->src_ == MPI_ANY_SOURCE || req->src_ == ref->src_) + if(((req->src_ == MPI_ANY_SOURCE && (req->comm_->group()->rank(ref->src_) != MPI_UNDEFINED)) || req->src_ == ref->src_) && ((req->tag_ == MPI_ANY_TAG && ref->tag_ >=0)|| req->tag_ == ref->tag_)){ if(req->src_ == MPI_ANY_SOURCE) req->real_src_ = ref->src_; -- 2.20.1