Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix the execution with NS3
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 1 May 2017 20:54:36 +0000 (22:54 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 1 May 2017 20:54:36 +0000 (22:54 +0200)
src/smpi/smpi_global.cpp

index 39d769a..0ae9822 100644 (file)
@@ -95,7 +95,10 @@ int smpi_process_count()
 
 simgrid::smpi::Process* smpi_process()
 {
-  simgrid::MsgActorExt* msgExt = static_cast<simgrid::MsgActorExt*>(SIMIX_process_self()->data);
+  smx_actor_t me = SIMIX_process_self();
+  if (me == nullptr) // This happens sometimes (eg, when linking against NS3 because it pulls openMPI...)
+    return nullptr;
+  simgrid::MsgActorExt* msgExt = static_cast<simgrid::MsgActorExt*>(me->data);
   return static_cast<simgrid::smpi::Process*>(msgExt->data);
 }