Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
portability cheating: avoid the configurations that are known to be broken
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 5 May 2017 06:31:03 +0000 (08:31 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 5 May 2017 06:31:03 +0000 (08:31 +0200)
ChangeLog
src/simix/smx_context.cpp
src/smpi/smpi_global.cpp
teshsuite/smpi/privatization/privatization_dlopen.tesh

index 0fc46d7..1bc9b8c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,15 @@
 SimGrid (3.16) UNRELEASED
 
-SimDag
- - New and Backwards Compatibility break: 
-   SD_simulate_with_update (double how_long, xbt_dynar_t changed_tasks_dynar)
-   When one wants to get the list of tasks whose states have changed during a
-   simulation round, s/he has to allocate and free a dynar and use it as argument 
-   to this function. The former SD_simulate (double how_long) now returns void.
+ Portability status:
+  - FreeBSD: Disable SMPI mmap privatization, switch automatically to dlopen.
+  - Mac, BSD: dlopen+thread broken, switch automatically to raw contexts.
+
+ SimDag
+  - New and Backwards Compatibility break: 
+    SD_simulate_with_update (double how_long, xbt_dynar_t changed_tasks_dynar)
+    When one wants to get the list of tasks whose states have changed during a
+    simulation round, s/he has to allocate and free a dynar and use it as argument 
+    to this function. The former SD_simulate (double how_long) now returns void.
 
  SMPI
   - New algorithm to privatize globals: dlopen, with dynamic loading tricks
index b382461..90a7d13 100644 (file)
@@ -106,6 +106,20 @@ void SIMIX_context_mod_init()
   xbt_os_thread_key_create(&smx_current_context_key);
 #endif
 
+#if defined(__APPLE__) || defined(__NetBSD__)
+  if (context_factory_name == std::string("thread") &&
+      strcmp(xbt_cfg_get_string("smpi/privatization"), "dlopen") == 0) {
+    XBT_WARN("dlopen+thread broken on Apple and BSD. Switching to raw contexts.");
+    context_factory_name = "raw";
+  }
+#endif
+#if defined(__FreeBSD__)
+  if (context_factory_name == std::string("thread") && strcmp(xbt_cfg_get_string("smpi/privatization"), "no") != 0) {
+    XBT_WARN("mmap broken on FreeBSD, but dlopen+thread broken too. Switching to dlopen+raw contexts.");
+    context_factory_name = "raw";
+  }
+#endif
+
   /* select the context factory to use to create the contexts */
   if (simgrid::kernel::context::factory_initializer) { // Give Java a chance to hijack the factory mechanism
     simix_global->context_factory = simgrid::kernel::context::factory_initializer();
index 7df8301..3770ba2 100644 (file)
@@ -476,6 +476,13 @@ static void smpi_init_options(){
     else
       xbt_die("Invalid value for smpi/privatization: '%s'", smpi_privatize_option);
 
+#if defined(__FreeBSD__)
+    if (smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP) {
+      XBT_INFO("Mixing mmap privatization is broken on FreeBSD, switching to dlopen privatization instead.");
+      smpi_privatize_global_variables = SMPI_PRIVATIZE_DLOPEN;
+    }
+#endif
+
     if (smpi_cpu_threshold < 0)
       smpi_cpu_threshold = DBL_MAX;
 
index 6d8f954..8255188 100644 (file)
@@ -1,5 +1,5 @@
 p Test privatization with dlopen
 ! setenv LD_LIBRARY_PATH=../../lib
 ! timeout 5
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 32 ${bindir:=.}/privatization --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/privatization:dlopen
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 32 ${bindir:=.}/privatization --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/privatization:dlopen --log=simix_context.thres:error
 > You requested to use 32 processes, but there is only 5 processes in your hostfile...