static void smpi_init_privatization_dlopen(std::string executable)
{
- std::string executable_copy = executable;
-
// Prepare the copy of the binary (get its size)
struct stat fdin_stat;
- stat(executable_copy.c_str(), &fdin_stat);
+ stat(executable.c_str(), &fdin_stat);
off_t fdin_size = fdin_stat.st_size;
static std::size_t rank = 0;
}
}
- simix_global->default_function = [executable_copy, fdin_size](std::vector<std::string> args) {
- return std::function<void()>([executable_copy, fdin_size, args] {
+ simix_global->default_function = [executable, fdin_size](std::vector<std::string> args) {
+ return std::function<void()>([executable, fdin_size, args] {
// Copy the dynamic library:
std::string target_executable =
- executable_copy + "_" + std::to_string(getpid()) + "_" + std::to_string(rank) + ".so";
+ executable + "_" + std::to_string(getpid()) + "_" + std::to_string(rank) + ".so";
- smpi_copy_file(executable_copy, target_executable, fdin_size);
+ smpi_copy_file(executable, target_executable, fdin_size);
// if smpi/privatize-libs is set, duplicate pointed lib and link each executable copy to a different one.
std::string target_lib;
for (auto const& libpath : privatize_libs_paths) {
};
}
-static void smpi_init_privatization_no_dlopen(const char* executable)
+static void smpi_init_privatization_no_dlopen(std::string executable)
{
if (smpi_privatize_global_variables == SmpiPrivStrategies::MMAP)
smpi_prepare_global_memory_segment();
// Load the dynamic library and resolve the entry point:
- void* handle = dlopen(executable, RTLD_LAZY | RTLD_LOCAL);
+ void* handle = dlopen(executable.c_str(), RTLD_LAZY | RTLD_LOCAL);
if (handle == nullptr)
- xbt_die("dlopen failed for %s: %s (errno: %d -- %s)", executable, dlerror(), errno, strerror(errno));
+ xbt_die("dlopen failed for %s: %s (errno: %d -- %s)", executable.c_str(), dlerror(), errno, strerror(errno));
smpi_entry_point_type entry_point = smpi_resolve_function(handle);
if (not entry_point)
- xbt_die("main not found in %s", executable);
+ xbt_die("main not found in %s", executable.c_str());
if (smpi_privatize_global_variables == SmpiPrivStrategies::MMAP)
smpi_backup_global_memory_segment();
TRACE_global_init();
SIMIX_global_init(&argc, argv);
- MSG_init(&argc, argv);
+ MSG_init(&argc, argv); // FIXME Remove this MSG call. Once it's removed, we can remove the msg header include as well
SMPI_switch_data_segment = &smpi_switch_data_segment;