Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
be more robust to plugins creating processes a bit early
[simgrid.git] / src / simix / smx_global.cpp
index dfcf0ba..a8538f4 100644 (file)
@@ -228,7 +228,8 @@ void SIMIX_global_init(int *argc, char **argv)
     sg_platf_init();
     simgrid::s4u::onPlatformCreated.connect(SIMIX_post_create_environment);
     simgrid::s4u::Host::onCreation.connect([](simgrid::s4u::Host& host) {
-      host.extension_set<simgrid::simix::Host>(new simgrid::simix::Host());
+      if (host.extension<simgrid::simix::Host>() == nullptr) // another callback to the same signal may have created it
+        host.extension_set<simgrid::simix::Host>(new simgrid::simix::Host());
     });
 
     simgrid::surf::storageCreatedCallbacks.connect([](simgrid::surf::Storage* storage) {