X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6633f5c4d1b7d52fa54306ee3fb7eb573daeb274..a4c8f1898670317d0fa33bf1b1a904ea922b78cc:/src/smpi/internals/smpi_memory.cpp diff --git a/src/smpi/internals/smpi_memory.cpp b/src/smpi/internals/smpi_memory.cpp index 44dad4447b..de20019985 100644 --- a/src/smpi/internals/smpi_memory.cpp +++ b/src/smpi/internals/smpi_memory.cpp @@ -57,8 +57,7 @@ static void smpi_get_executable_global_size() { char buffer[PATH_MAX]; char* full_name = realpath(xbt_binary_name, buffer); - if (full_name == nullptr) - xbt_die("Could not resolve binary file name"); + xbt_assert(full_name != nullptr, "Could not resolve real path of binary file '%s'", xbt_binary_name); std::vector map = simgrid::xbt::get_memory_map(getpid()); for (auto i = map.begin(); i != map.end() ; ++i) { @@ -111,23 +110,16 @@ static void* asan_safe_memcpy(void* dest, void* src, size_t n) #define asan_safe_memcpy(dest, src, n) memcpy(dest, src, n) #endif -/** Map a given SMPI privatization segment (make a SMPI process active) */ -void smpi_switch_data_segment(simgrid::s4u::ActorPtr actor) -{ - if (smpi_loaded_page == actor->get_pid()) // no need to switch, we've already loaded the one we want - return; - - // So the job: - smpi_really_switch_data_segment(actor); -} - -/** Map a given SMPI privatization segment (make a SMPI process active) even if SMPI thinks it is already active +/** Map a given SMPI privatization segment (make a 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. */ -void smpi_really_switch_data_segment(simgrid::s4u::ActorPtr actor) +void smpi_switch_data_segment(simgrid::s4u::ActorPtr actor) { + if (smpi_loaded_page == actor->get_pid()) // no need to switch, we've already loaded the one we want + return; + if (smpi_data_exe_size == 0) // no need to switch return; @@ -143,12 +135,6 @@ void smpi_really_switch_data_segment(simgrid::s4u::ActorPtr actor) #endif } -int smpi_is_privatization_file(char* file) -{ - const std::string buffer_path("/dev/shm/my-buffer-"); - return buffer_path.compare(0, std::string::npos, file, buffer_path.length()) == 0; -} - /** * @brief Makes a backup of the segment in memory that stores the global variables of a process. * This backup is then used to initialize the global variables for every single