Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
mpi_comm_self was cleaned after mpi finalization during actor deletion, which was...
authorAugustin Degomme <adegomme@gmail.com>
Wed, 3 Mar 2021 11:54:33 +0000 (12:54 +0100)
committerAugustin Degomme <adegomme@gmail.com>
Wed, 3 Mar 2021 11:54:33 +0000 (12:54 +0100)
Have it done at MPI_Finalize level.

src/smpi/internals/smpi_actor.cpp
src/smpi/mpi/smpi_comm.cpp

index 0463493..d97e4e1 100644 (file)
@@ -54,12 +54,6 @@ ActorExt::ActorExt(s4u::Actor* actor) : actor_(actor)
 
 ActorExt::~ActorExt()
 {
-  if (info_env_ != MPI_INFO_NULL)
-    simgrid::smpi::Info::unref(info_env_);
-  if (comm_self_ != MPI_COMM_NULL)
-    simgrid::smpi::Comm::destroy(comm_self_);
-  if (comm_intra_ != MPI_COMM_NULL)
-    simgrid::smpi::Comm::destroy(comm_intra_);
   xbt_os_timer_free(timer_);
 }
 
@@ -68,7 +62,12 @@ void ActorExt::finalize()
 {
   state_ = SmpiProcessState::FINALIZED;
   XBT_DEBUG("<%ld> Process left the game", actor_->get_pid());
-
+  if (info_env_ != MPI_INFO_NULL)
+    simgrid::smpi::Info::unref(info_env_);
+  if (comm_self_ != MPI_COMM_NULL)
+    simgrid::smpi::Comm::destroy(comm_self_);
+  if (comm_intra_ != MPI_COMM_NULL)
+    simgrid::smpi::Comm::destroy(comm_intra_);
   smpi_deployment_unregister_process(instance_id_);
 }
 
index 41590a2..3ce4890 100644 (file)
@@ -586,7 +586,7 @@ void Comm::set_errhandler(MPI_Errhandler errhandler)
       simgrid::smpi::Errhandler::unref(errhandlers_[this->rank()]);
     errhandlers_[this->rank()]=errhandler;
   }
-  if (errhandler != MPI_ERRHANDLER_NULL && this != MPI_COMM_SELF)
+  if (errhandler != MPI_ERRHANDLER_NULL)
     errhandler->ref();
 }