smpi_privatize_global_variables = SMPI_PRIVATIZE_NONE;
else
- xbt_die("Invalid value for smpi/privatization: %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;
+ "_" + 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<int>(fdin_size), target_executable.c_str());
const int bufsize = 1024 * 1024 * 4;
void* handle = dlopen(target_executable.c_str(), RTLD_LAZY | RTLD_LOCAL | RTLD_DEEPBIND);
unlink(target_executable.c_str());
if (handle == nullptr)
- xbt_die("dlopen failed");
+ xbt_die("dlopen failed: %s (errno: %d -- %s)", dlerror(), errno, strerror(errno));
smpi_entry_point_type entry_point = smpi_resolve_function(handle);
if (!entry_point)
xbt_die("Could not resolve entry point");