MPI_Errhandler *MPI_ERRHANDLER_NULL = nullptr;
// No instance gets manually created; check also the smpirun.in script as
// this default name is used there as well (when the <actor> tag is generated).
-static const char* smpi_default_instance_name = "smpirun";
+static const std::string smpi_default_instance_name("smpirun");
static simgrid::config::Flag<double> smpi_wtime_sleep(
"smpi/wtime", "Minimum time to inject inside a call to MPI_Wtime", 0.0);
static simgrid::config::Flag<double> smpi_init_sleep(
}
int smpi_process_index(){
- return simgrid::s4u::Actor::self()->getPid();
+ return simgrid::s4u::this_actor::getPid();
}
void * smpi_process_get_user_data(){
if ((smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP) && (static_cast<char*>(buff) >= smpi_data_exe_start) &&
(static_cast<char*>(buff) < smpi_data_exe_start + smpi_data_exe_size)) {
XBT_DEBUG("Privatization : We are copying from a zone inside global memory... Saving data to temp buffer !");
-
- smpi_switch_data_segment(Actor::self()->getPid());
+ smpi_switch_data_segment(comm->src_proc->iface());
tmpbuff = static_cast<void*>(xbt_malloc(buff_size));
memcpy_private(tmpbuff, buff, private_blocks);
}
if ((smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP) && ((char*)comm->dst_buff >= smpi_data_exe_start) &&
((char*)comm->dst_buff < smpi_data_exe_start + smpi_data_exe_size)) {
XBT_DEBUG("Privatization : We are copying to a zone inside global memory - Switch data segment");
- smpi_switch_data_segment(Actor::self()->getPid());
+ smpi_switch_data_segment(comm->dst_proc->iface());
}
XBT_DEBUG("Copying %zu bytes from %p to %p", buff_size, tmpbuff,comm->dst_buff);
memcpy_private(comm->dst_buff, tmpbuff, private_blocks);
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");
+ xbt_assert(smpi_host_speed >= 0, "You're trying to set the host_speed to a negative value (%f)", smpi_host_speed);
std::string smpi_privatize_option = xbt_cfg_get_string("smpi/privatization");
if (smpi_privatize_option == "no" || smpi_privatize_option == "0")
smpi_privatize_global_variables = SMPI_PRIVATIZE_NONE;
}
#endif
-#if defined(HAVE_SANITIZER)
- if (smpi_privatize_global_variables == SMPI_PRIVATIZE_DLOPEN) {
- XBT_INFO("Sanitizers don't like dlopen, switching to mmap privatization instead.");
- smpi_privatize_global_variables = SMPI_PRIVATIZE_MMAP;
- }
-#endif
-
if (smpi_cpu_threshold < 0)
smpi_cpu_threshold = DBL_MAX;
smpi_run_entry_point(entry_point, args);
});
};
-
}
else {
-
// Load the dynamic library and resolve the entry point:
void* handle = dlopen(executable, RTLD_LAZY | RTLD_LOCAL);
if (handle == nullptr)
smpi_run_entry_point(entry_point, args);
});
};
-
}
SMPI_init();
SIMIX_launch_application(argv[2]);
- SMPI_app_instance_register(smpi_default_instance_name, nullptr,
+ SMPI_app_instance_register(smpi_default_instance_name.c_str(), nullptr,
process_data.size()); // This call has a side effect on process_count...
MPI_COMM_WORLD = *smpi_deployment_comm_world(smpi_default_instance_name);
smpi_universe_size = process_count;