From: Martin Quinson Date: Mon, 16 Sep 2019 22:14:16 +0000 (+0200) Subject: remove another pimpl in smpi initialization X-Git-Tag: v3.24~69^2~4 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/0d3e38471afd4fd0d3ba5e65090ccf0122ba2532 remove another pimpl in smpi initialization --- diff --git a/src/smpi/internals/smpi_deployment.cpp b/src/smpi/internals/smpi_deployment.cpp index 54f42e1fc0..5e74b69313 100644 --- a/src/smpi/internals/smpi_deployment.cpp +++ b/src/smpi/internals/smpi_deployment.cpp @@ -61,13 +61,6 @@ void SMPI_app_instance_register(const char *name, xbt_main_func_t code, int num_ if (code != nullptr) // When started with smpirun, we will not execute a function simgrid::s4u::Engine::get_instance()->register_function(name, code); - static bool already_called = false; - if (not already_called) { - already_called = true; - for (auto const& host : simgrid::s4u::Engine::get_instance()->get_all_hosts()) - host->extension_set(new simgrid::smpi::Host(host)); - } - Instance instance(std::string(name), num_processes, MPI_COMM_NULL); smpi_instances.insert(std::pair(name, instance)); diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index ed575dd18a..c1d547665e 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -681,6 +681,8 @@ void SMPI_init(){ }); simgrid::s4u::Host::on_creation.connect( [](simgrid::s4u::Host& host) { host.extension_set(new simgrid::smpi::Host(&host)); }); + for (auto const& host : simgrid::s4u::Engine::get_instance()->get_all_hosts()) + host->extension_set(new simgrid::smpi::Host(host)); smpi_init_options(); if (not MC_is_active()) {