From 083e5bc3e59e935868789304e8bc5d906000a173 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 20 Apr 2017 12:27:48 +0200 Subject: [PATCH] rename option smpi/privatize-global-variables to smpi/privatization --- doc/doxygen/options.doc | 6 +++--- src/simgrid/sg_config.cpp | 5 +++-- src/simix/smx_global.cpp | 4 ++-- src/smpi/smpi_global.cpp | 5 ++--- src/smpi/smpirun.in | 2 +- teshsuite/smpi/mpich3-test/runtests | 2 +- tools/cmake/Tests.cmake | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/doc/doxygen/options.doc b/doc/doxygen/options.doc index 08c69d2029..b508671861 100644 --- a/doc/doxygen/options.doc +++ b/doc/doxygen/options.doc @@ -895,11 +895,11 @@ of counters, the "default" set. --cfg=smpi/papi-events:"default:PAPI_L3_LDM:PAPI_L2_LDM" \endverbatim -\subsection options_smpi_global smpi/privatize-global-variables: Automatic privatization of global variables +\subsection options_smpi_global smpi/privatization: Automatic privatization of global variables -MPI executables are meant to be executed in separated processes, but SMPI is +MPI executables are usually meant to be executed in separated processes, but SMPI is executed in only one process. Global variables from executables will be placed -in the same memory zone and shared between processes, causing hard to find bugs. +in the same memory zone and shared between processes, causing intricate bugs. Several options are possible to avoid this, as described in the main SMPI publication. SimGrid provides two ways of automatically privatizing the globals, diff --git a/src/simgrid/sg_config.cpp b/src/simgrid/sg_config.cpp index 5f7437a8aa..ede4743c4b 100644 --- a/src/simgrid/sg_config.cpp +++ b/src/simgrid/sg_config.cpp @@ -503,10 +503,11 @@ void sg_config_init(int *argc, char **argv) if (default_privatization == nullptr) default_privatization = "no"; - xbt_cfg_register_string("smpi/privatize-global-variables", default_privatization, nullptr, + xbt_cfg_register_string("smpi/privatization", default_privatization, nullptr, "How we should privatize global variable at runtime (no, yes, mmap, dlopen)."); - xbt_cfg_register_alias("smpi/privatize-global-variables", "smpi/privatize_global_variables"); + xbt_cfg_register_alias("smpi/privatization", "smpi/privatize-global-variables"); + xbt_cfg_register_alias("smpi/privatization", "smpi/privatize_global_variables"); xbt_cfg_register_boolean("smpi/grow-injected-times", "yes", nullptr, "Whether we want to make the injected time in MPI_Iprobe and MPI_Test grow, to allow faster simulation. This can make simulation less precise, though."); diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index 341c3e3573..e34130da60 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -96,9 +96,9 @@ static void segvhandler(int signum, siginfo_t *siginfo, void *context) #if HAVE_SMPI if (smpi_enabled() && smpi_privatize_global_variables == SMPI_PRIVATIZE_NONE) { #if HAVE_PRIVATIZATION - fprintf(stderr, "Try to enable SMPI variable privatization with --cfg=smpi/privatize-global-variables:yes.\n"); + fprintf(stderr, "Try to enable SMPI variable privatization with --cfg=smpi/privatization:yes.\n"); #else - fprintf(stderr, "Sadly, your system does not support --cfg=smpi/privatize-global-variables:yes (yet).\n"); + fprintf(stderr, "Sadly, your system does not support --cfg=smpi/privatization:yes (yet).\n"); #endif /* HAVE_PRIVATIZATION */ } #endif /* HAVE_SMPI */ diff --git a/src/smpi/smpi_global.cpp b/src/smpi/smpi_global.cpp index 6234227715..cf5d34206c 100644 --- a/src/smpi/smpi_global.cpp +++ b/src/smpi/smpi_global.cpp @@ -446,7 +446,7 @@ static void smpi_init_options(){ simgrid::smpi::Colls::smpi_coll_cleanup_callback=nullptr; smpi_cpu_threshold = xbt_cfg_get_double("smpi/cpu-threshold"); smpi_host_speed = xbt_cfg_get_double("smpi/host-speed"); - const char* smpi_privatize_option = xbt_cfg_get_string("smpi/privatize-global-variables"); + const char* smpi_privatize_option = xbt_cfg_get_string("smpi/privatization"); if (std::strcmp(smpi_privatize_option, "no") == 0) smpi_privatize_global_variables = SMPI_PRIVATIZE_NONE; else if (std::strcmp(smpi_privatize_option, "yes") == 0) @@ -463,8 +463,7 @@ static void smpi_init_options(){ smpi_privatize_global_variables = SMPI_PRIVATIZE_NONE; else - xbt_die("Invalid value for smpi/privatize-global-variables: %s", - smpi_privatize_option); + xbt_die("Invalid value for smpi/privatization: %s", smpi_privatize_option); if (smpi_cpu_threshold < 0) smpi_cpu_threshold = DBL_MAX; diff --git a/src/smpi/smpirun.in b/src/smpi/smpirun.in index b6a7ec5339..7c83e0f301 100755 --- a/src/smpi/smpirun.in +++ b/src/smpi/smpirun.in @@ -23,7 +23,7 @@ NETWORK_BANDWIDTH="${DEFAULT_NETWORK_BANDWIDTH}" NETWORK_LATENCY="${DEFAULT_NETWORK_LATENCY}" SPEED="${DEFAULT_SPEED}" -PRIVATIZE="--cfg=smpi/privatize-global-variables:@HAVE_PRIVATIZATION@" +PRIVATIZE="--cfg=smpi/privatization:@HAVE_PRIVATIZATION@" SIMOPTS="--cfg=surf/precision:1e-9 --cfg=network/model:SMPI --cfg=network/TCP-gamma:4194304" diff --git a/teshsuite/smpi/mpich3-test/runtests b/teshsuite/smpi/mpich3-test/runtests index 1e7ce7cbac..4bd97a2d43 100755 --- a/teshsuite/smpi/mpich3-test/runtests +++ b/teshsuite/smpi/mpich3-test/runtests @@ -422,7 +422,7 @@ sub RunList { # skip empty lines if ($programname eq "") { next; } - #if privatization is disabled, and if the test needs it, ignore it + # if privatization is disabled, and if the test needs it, ignore it if ($needs_privatization == 1 && $enabled_privatization != 1) { SkippedTest($programname, $np, $workdir, "requires SMPI privatization"); diff --git a/tools/cmake/Tests.cmake b/tools/cmake/Tests.cmake index 07e97ce0bf..f207bfc5f9 100644 --- a/tools/cmake/Tests.cmake +++ b/tools/cmake/Tests.cmake @@ -73,9 +73,9 @@ IF(HAVE_MC) ENDIF() IF(enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN AND HAVE_THREAD_CONTEXTS) - ADD_TEST(test-smpi-mpich3-thread-f77 ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f77/ ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f77/ -tests=testlist -privatization=${HAVE_PRIVATIZATION} -execarg=--cfg=contexts/stack_size:8000 -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/privatize-global-variables:${HAVE_PRIVATIZATION}) + ADD_TEST(test-smpi-mpich3-thread-f77 ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f77/ ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f77/ -tests=testlist -privatization=${HAVE_PRIVATIZATION} -execarg=--cfg=contexts/stack_size:8000 -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION}) SET_TESTS_PROPERTIES(test-smpi-mpich3-thread-f77 PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!") - ADD_TEST(test-smpi-mpich3-thread-f90 ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f90/ ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f90/ -tests=testlist -privatization=${HAVE_PRIVATIZATION} -execarg=--cfg=smpi/privatize-global-variables:${HAVE_PRIVATIZATION} -execarg=--cfg=contexts/factory:thread) + ADD_TEST(test-smpi-mpich3-thread-f90 ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f90/ ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f90/ -tests=testlist -privatization=${HAVE_PRIVATIZATION} -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION} -execarg=--cfg=contexts/factory:thread) SET_TESTS_PROPERTIES(test-smpi-mpich3-thread-f90 PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!") ENDIF() -- 2.20.1