Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
mpi_comm_self was cleaned after mpi finalization during actor deletion, which was...
[simgrid.git] / src / smpi / internals / smpi_actor.cpp
index 1c332e8..d97e4e1 100644 (file)
@@ -12,7 +12,6 @@
 
 #if HAVE_PAPI
 #include "papi.h"
-extern std::string papi_default_config_name;
 #endif
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_process, smpi, "Logging specific to SMPI (kernel)");
@@ -40,7 +39,7 @@ ActorExt::ActorExt(s4u::Actor* actor) : actor_(actor)
     // TODO: Implement host/process/thread based counters. This implementation
     // just always takes the values passed via "default", like this:
     // "default:COUNTER1:COUNTER2:COUNTER3;".
-    auto it = units2papi_setup.find(papi_default_config_name);
+    auto it = units2papi_setup.find("default");
     if (it != units2papi_setup.end()) {
       papi_event_set_    = it->second.event_set;
       papi_counter_data_ = it->second.counter_data;
@@ -55,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_);
 }
 
@@ -69,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_);
 }