constexpr unsigned MPI_REQ_GENERALIZED = 0x800;
constexpr unsigned MPI_REQ_COMPLETE = 0x1000;
-enum class SmpiProcessState { UNINITIALIZED, INITIALIZING, INITIALIZED, FINALIZED };
+enum class SmpiProcessState { UNINITIALIZED, INITIALIZING, INITIALIZED /*(=MPI_Init called)*/, FINALIZED };
constexpr int COLL_TAG_REDUCE = -112;
constexpr int COLL_TAG_SCATTER = -223;
extern XBT_PRIVATE SharedMallocType smpi_cfg_shared_malloc; // Whether to activate shared malloc
XBT_PRIVATE void smpi_switch_data_segment(simgrid::s4u::ActorPtr actor);
-XBT_PRIVATE void smpi_really_switch_data_segment(simgrid::s4u::ActorPtr actor);
XBT_PRIVATE void smpi_prepare_global_memory_segment();
XBT_PRIVATE void smpi_backup_global_memory_segment();
simgrid::s4u::ActorPtr self = simgrid::s4u::Actor::self();
// cheinrich: I'm not sure what the impact of the SMPI_switch_data_segment on this call is. I moved
// this up here so that I can set the privatized region before the switch.
- ActorExt* ext = smpi_process_remote(self);
+ ActorExt* ext = smpi_process();
// if we are in MPI_Init and argc handling has already been done.
if (ext->initialized())
return;
{
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<simgrid::xbt::VmMap> map = simgrid::xbt::get_memory_map(getpid());
for (auto i = map.begin(); i != map.end() ; ++i) {
#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;