Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Restore public smpi_init_options().
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 4 Jun 2021 15:45:07 +0000 (17:45 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 4 Jun 2021 15:55:29 +0000 (17:55 +0200)
It was wrongly removed in commit 6a046487fb Make smpi_switch_data_segment check if a switch is needed, and return true when it occurs.

include/smpi/smpi.h
src/simix/smx_context.cpp
src/smpi/include/private.hpp
src/smpi/internals/smpi_config.cpp
src/smpi/internals/smpi_global.cpp

index 69d1169..f9cba1c 100644 (file)
@@ -1141,6 +1141,7 @@ XBT_PUBLIC MPI_Comm smpi_process_comm_self();
 XBT_PUBLIC MPI_Info smpi_process_info_env();
 XBT_PUBLIC void* smpi_process_get_user_data();
 XBT_PUBLIC void smpi_process_set_user_data(void*);
+XBT_PUBLIC void smpi_init_options();
 
 XBT_PUBLIC void smpi_execute_flops(double flops);
 XBT_PUBLIC void smpi_execute_flops_benched(double flops);
index 3f78c98..2d40401 100644 (file)
@@ -61,7 +61,7 @@ void SIMIX_context_mod_init()
   xbt_assert(not simix_global->has_context_factory());
 
 #if HAVE_SMPI && (defined(__APPLE__) || defined(__NetBSD__))
-  smpi_init_options();
+  smpi_init_options_internal(false);
   std::string priv = simgrid::config::get_value<std::string>("smpi/privatization");
   if (context_factory_name == "thread" && (priv == "dlopen" || priv == "yes" || priv == "default" || priv == "1")) {
     XBT_WARN("dlopen+thread broken on Apple and BSD. Switching to raw contexts.");
@@ -70,7 +70,7 @@ void SIMIX_context_mod_init()
 #endif
 
 #if HAVE_SMPI && defined(__FreeBSD__)
-  smpi_init_options();
+  smpi_init_options_internal(false);
   if (context_factory_name == "thread" && simgrid::config::get_value<std::string>("smpi/privatization") != "no") {
     XBT_WARN("mmap broken on FreeBSD, but dlopen+thread broken too. Switching to dlopen+raw contexts.");
     context_factory_name = "raw";
index 7791846..4abec6c 100644 (file)
@@ -117,7 +117,7 @@ XBT_PRIVATE double smpi_cfg_auto_shared_malloc_thresh();
 XBT_PRIVATE bool smpi_cfg_display_alloc();
 
 // utilities
-XBT_PUBLIC void smpi_init_options(bool called_by_smpimain = false);
+XBT_PRIVATE void smpi_init_options_internal(bool called_by_smpimain);
 
 extern XBT_PRIVATE char* smpi_data_exe_start; // start of the data+bss segment of the executable
 extern XBT_PRIVATE size_t smpi_data_exe_size; // size of the data+bss segment of the executable
index 9a4fe2e..8165bad 100644 (file)
@@ -187,7 +187,13 @@ double smpi_cfg_auto_shared_malloc_thresh(){
   return _smpi_cfg_auto_shared_malloc_thresh;
 }
 
-void smpi_init_options(bool called_by_smpimain)
+// public version declared in smpi.h (without parameter, and with C linkage)
+void smpi_init_options()
+{
+  smpi_init_options_internal(false);
+}
+
+void smpi_init_options_internal(bool called_by_smpimain)
 {
   // return if already called
   if(_smpi_options_initialized)
index 87b7b07..e267174 100644 (file)
@@ -540,7 +540,7 @@ int smpi_main(const char* executable, int argc, char* argv[])
     return 0;
   }
 
-  smpi_init_options(true);
+  smpi_init_options_internal(true);
   simgrid::instr::init();
   SIMIX_global_init(&argc, argv);
 
@@ -586,7 +586,7 @@ int smpi_main(const char* executable, int argc, char* argv[])
 
 // Called either directly from the user code, or from the code called by smpirun
 void SMPI_init(){
-  smpi_init_options();
+  smpi_init_options_internal(false);
   simgrid::s4u::Actor::on_creation.connect([](simgrid::s4u::Actor& actor) {
     if (not actor.is_daemon())
       actor.extension_set<simgrid::smpi::ActorExt>(new simgrid::smpi::ActorExt(&actor));