From: degomme Date: Fri, 14 Apr 2017 08:18:44 +0000 (+0200) Subject: Patch up smpi process creation ... X-Git-Tag: v3.16~356 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/00b1be74283514cdf226b69c08f1f4b9798ca5cd Patch up smpi process creation ... Dirty, as this will call smpi_init_options twice, so add a return for the second call. --- diff --git a/src/smpi/smpi_bench.cpp b/src/smpi/smpi_bench.cpp index b925281d80..c27028aae7 100644 --- a/src/smpi/smpi_bench.cpp +++ b/src/smpi/smpi_bench.cpp @@ -36,7 +36,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_bench, smpi, "Logging specific to SMPI (ben xbt_dict_t samples = nullptr; /* Allocated on first use */ -double smpi_cpu_threshold; +double smpi_cpu_threshold = -1; double smpi_host_speed; shared_malloc_type smpi_cfg_shared_malloc = shmalloc_global; diff --git a/src/smpi/smpi_global.cpp b/src/smpi/smpi_global.cpp index 05216bfce3..a05d57fe19 100644 --- a/src/smpi/smpi_global.cpp +++ b/src/smpi/smpi_global.cpp @@ -401,7 +401,9 @@ static void smpi_init_logs(){ } static void smpi_init_options(){ - + //return if already called + if(smpi_cpu_threshold!=-1) + return; simgrid::smpi::Colls::set_collectives(); simgrid::smpi::Colls::smpi_coll_cleanup_callback=nullptr; smpi_cpu_threshold = xbt_cfg_get_double("smpi/cpu-threshold"); @@ -523,6 +525,8 @@ int smpi_main(const char* executable, int argc, char *argv[]) static std::size_t rank = 0; + smpi_init_options(); + if (smpi_privatize_global_variables == SMPI_PRIVATIZE_DLOPEN) { std::string executable_copy = executable;