Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
select proper errhandler when MPI_COMM_WORLD is duplicated
authorAugustin Degomme <adegomme@gmail.com>
Fri, 2 Apr 2021 15:31:12 +0000 (17:31 +0200)
committerAugustin Degomme <adegomme@gmail.com>
Fri, 2 Apr 2021 18:03:31 +0000 (20:03 +0200)
src/smpi/mpi/smpi_comm.cpp

index fb45970..a10451b 100644 (file)
@@ -113,7 +113,10 @@ int Comm::dup(MPI_Comm* newcomm){
   if(info_!=MPI_INFO_NULL)
     (*newcomm)->info_ = new simgrid::smpi::Info(info_);
   //duplicate errhandler
-  (*newcomm)->set_errhandler(errhandler_);
+  if (errhandlers_ != nullptr)//MPI_COMM_WORLD, only grab our own
+    (*newcomm)->set_errhandler(errhandlers_[this->rank()]);
+  else
+    (*newcomm)->set_errhandler(errhandler_);
   return ret;
 }