Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Patch up smpi process creation ...
authordegomme <augustin.degomme@unibas.ch>
Fri, 14 Apr 2017 08:18:44 +0000 (10:18 +0200)
committerdegomme <augustin.degomme@unibas.ch>
Fri, 14 Apr 2017 08:18:44 +0000 (10:18 +0200)
Dirty, as this will call smpi_init_options twice, so add a return for the second call.

src/smpi/smpi_bench.cpp
src/smpi/smpi_global.cpp

index b925281..c27028a 100644 (file)
@@ -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;
index 05216bf..a05d57f 100644 (file)
@@ -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;