# 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
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;
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<std::string> args)
{
// copy C strings, we need them writable
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 */