Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
smpi: some useless cleanups while I read this code
[simgrid.git] / src / smpi / internals / smpi_actor.cpp
index 0a9a96d..3a5af91 100644 (file)
@@ -27,6 +27,7 @@ ActorExt::ActorExt(s4u::ActorPtr actor, s4u::Barrier* finalization_barrier)
   mailboxes_mutex_ = s4u::Mutex::create();
   timer_           = xbt_os_timer_new();
   state_           = SmpiProcessState::UNINITIALIZED;
+  info_env_        = MPI_INFO_NULL;
   if (MC_is_active())
     MC_ignore_heap(timer_, xbt_os_timer_size());
 
@@ -193,6 +194,11 @@ MPI_Comm ActorExt::comm_self()
   return comm_self_;
 }
 
+MPI_Info ActorExt::info_env()
+{
+  return info_env_;
+}
+
 MPI_Comm ActorExt::comm_intra()
 {
   return comm_intra_;
@@ -215,10 +221,8 @@ int ActorExt::sampling()
 
 void ActorExt::init()
 {
-  if (smpi_process_count() == 0) {
-    xbt_die("SimGrid was not initialized properly before entering MPI_Init. Aborting, please check compilation process "
-            "and use smpirun\n");
-  }
+  xbt_assert(smpi_process_count() != 0, "SimGrid was not initialized properly before entering MPI_Init. "
+                                        "Aborting, please check compilation process and use smpirun.");
 
   simgrid::s4u::ActorPtr proc = simgrid::s4u::Actor::self();
   // cheinrich: I'm not sure what the impact of the SMPI_switch_data_segment on this call is. I moved
@@ -235,8 +239,8 @@ void ActorExt::init()
     SMPI_switch_data_segment(proc);
   }
 
-  const char* instance_id = simgrid::s4u::Actor::self()->get_property("instance_id");
-  const int rank          = xbt_str_parse_int(simgrid::s4u::Actor::self()->get_property("rank"), "Cannot parse rank");
+  const char* instance_id = proc->get_property("instance_id");
+  const int rank          = xbt_str_parse_int(proc->get_property("rank"), "Cannot parse rank");
 
   process->state_ = SmpiProcessState::INITIALIZING;
   smpi_deployment_register_process(instance_id, rank, proc);
@@ -248,6 +252,7 @@ int ActorExt::get_optind()
 {
   return optind_;
 }
+
 void ActorExt::set_optind(int new_optind)
 {
   optind_ = new_optind;