From: Martin Quinson Date: Fri, 5 May 2017 06:31:03 +0000 (+0200) Subject: portability cheating: avoid the configurations that are known to be broken X-Git-Tag: v3.16~274^2~67 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/19d960b39f76697f0de77a09768f8e5b89f0c8b4 portability cheating: avoid the configurations that are known to be broken --- diff --git a/ChangeLog b/ChangeLog index 0fc46d7f3d..1bc9b8ced4 100644 --- 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 diff --git a/src/simix/smx_context.cpp b/src/simix/smx_context.cpp index b3824614f8..90a7d13ba0 100644 --- a/src/simix/smx_context.cpp +++ b/src/simix/smx_context.cpp @@ -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(); diff --git a/src/smpi/smpi_global.cpp b/src/smpi/smpi_global.cpp index 7df8301c58..3770ba29ea 100644 --- a/src/smpi/smpi_global.cpp +++ b/src/smpi/smpi_global.cpp @@ -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; diff --git a/teshsuite/smpi/privatization/privatization_dlopen.tesh b/teshsuite/smpi/privatization/privatization_dlopen.tesh index 6d8f954e44..82551884a9 100644 --- a/teshsuite/smpi/privatization/privatization_dlopen.tesh +++ b/teshsuite/smpi/privatization/privatization_dlopen.tesh @@ -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...