static void smpi_get_executable_global_size()
{
- char buffer[PATH_MAX];
- const char* full_name = realpath(simgrid::xbt::binary_name.c_str(), buffer);
- xbt_assert(full_name != nullptr, "Could not resolve real path of binary file '%s'",
- simgrid::xbt::binary_name.c_str());
+ char* buffer = realpath(simgrid::xbt::binary_name.c_str(), nullptr);
+ xbt_assert(buffer != nullptr, "Could not resolve real path of binary file '%s'", simgrid::xbt::binary_name.c_str());
+ std::string full_name = buffer;
+ free(buffer);
std::vector<simgrid::xbt::VmMap> map = simgrid::xbt::get_memory_map(getpid());
for (auto i = map.begin(); i != map.end() ; ++i) {
return mem;
}
-/** Map a given SMPI privatization segment (make a SMPI process active)
+/** Map a given SMPI privatization segment (make an SMPI process active)
*
* When doing a state restoration, the state of the restored variables might not be consistent with the state of the
* virtual memory. In this case, we to change the data segment.
#if HAVE_PRIVATIZATION
// FIXME, cross-process support (mmap across process when necessary)
XBT_DEBUG("Switching data frame to the one of process %ld", actor->get_pid());
- simgrid::smpi::ActorExt* process = smpi_process_remote(actor);
+ const simgrid::smpi::ActorExt* process = smpi_process_remote(actor);
int current = process->privatized_region()->file_descriptor;
const void* tmp = mmap(TOPAGE(smpi_data_exe_start), smpi_data_exe_size, PROT_RW, MAP_FIXED | MAP_SHARED, current, 0);
if (tmp != TOPAGE(smpi_data_exe_start))