X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a146138b74c78c8e7de7294457eb0440a91a7dd9..217ab9d5146bf370bbb20065fd357a5c099c78ee:/src/smpi/internals/smpi_global.cpp diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index 61f16b1ccc..70def16015 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -30,11 +30,11 @@ # ifndef MAC_OS_X_VERSION_10_12 # define MAC_OS_X_VERSION_10_12 101200 # endif -# define HAVE_WORKING_MMAP (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12) +constexpr bool HAVE_WORKING_MMAP = (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12); #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) -# define HAVE_WORKING_MMAP 0 +constexpr bool HAVE_WORKING_MMAP = false; #else -# define HAVE_WORKING_MMAP 1 +constexpr bool HAVE_WORKING_MMAP = true; #endif #if SG_HAVE_SENDFILE @@ -398,12 +398,10 @@ static void smpi_init_options(){ XBT_DEBUG("Running without smpi_main(); disable smpi/privatization."); smpi_privatize_global_variables = SmpiPrivStrategies::NONE; } -#if !HAVE_WORKING_MMAP - if (smpi_privatize_global_variables == SmpiPrivStrategies::MMAP) { + if (not HAVE_WORKING_MMAP && smpi_privatize_global_variables == SmpiPrivStrategies::MMAP) { XBT_INFO("mmap privatization is broken on this platform, switching to dlopen privatization instead."); smpi_privatize_global_variables = SmpiPrivStrategies::DLOPEN; } -#endif if (smpi_cpu_threshold < 0) smpi_cpu_threshold = DBL_MAX; @@ -425,7 +423,7 @@ typedef std::function smpi_entry_point_type; typedef int (* smpi_c_entry_point_type)(int argc, char **argv); typedef void (*smpi_fortran_entry_point_type)(); -static int smpi_run_entry_point(smpi_entry_point_type entry_point, const std::string& executable_path, +static int smpi_run_entry_point(const smpi_entry_point_type& entry_point, const std::string& executable_path, std::vector args) { // copy C strings, we need them writable @@ -663,8 +661,6 @@ static void smpi_init_privatization_no_dlopen(const std::string& executable) int smpi_main(const char* executable, int argc, char* argv[]) { - srand(SMPI_RAND_SEED); - if (getenv("SMPI_PRETEND_CC") != nullptr) { /* Hack to ensure that smpicc can pretend to be a simple compiler. Particularly handy to pass it to the * configuration tools */