X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f78bb9df687c6cf26ca6f2b9e5f86fd687c5dcf1..e0ba02850ce33d8eda9ba10a68db10af76f0ef29:/src/smpi/smpi_global.cpp diff --git a/src/smpi/smpi_global.cpp b/src/smpi/smpi_global.cpp index a47b7e976a..5910e15e82 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; @@ -484,7 +483,7 @@ static void smpi_init_options(){ 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)(void); +typedef void (*smpi_fortran_entry_point_type)(); static int smpi_run_entry_point(smpi_entry_point_type entry_point, std::vector args) { @@ -571,11 +570,12 @@ int smpi_main(const char* executable, int argc, char *argv[]) + "_" + std::to_string(getpid()) + "_" + std::to_string(rank++) + ".so"; - int fdout = open(target_executable.c_str(), O_WRONLY); + int fdout = open(target_executable.c_str(), O_CREAT | O_RDWR, S_IRWXU); xbt_assert(fdout >= 0, "Cannot write into %s", target_executable.c_str()); #if HAVE_SENDFILE - sendfile(fdout, fdin, NULL, fdin_size); + off_t offset = 0; + sendfile(fdout, fdin, &offset, fdin_size); #else XBT_WARN("Copy %d bytes into %s", static_cast(fdin_size), target_executable.c_str()); const int bufsize = 1024 * 1024 * 4;