- if (smpi_cfg_privatization() == SmpiPrivStrategies::MMAP) {
- /* Now using the segment index of this process */
- ext->set_privatized_region(smpi_init_global_memory_segment_process());
- /* Done at the process's creation */
- SMPI_switch_data_segment(self);
- }
-
- ext->instance_id_ = self->get_property("instance_id");
- const int rank = xbt_str_parse_int(self->get_property("rank"), "Cannot parse rank");
+ const simgrid::s4u::Actor* self = simgrid::s4u::Actor::self();
+ const char* id = self->get_property("instance_id");
+ xbt_assert(id != nullptr, "Actor '%s' seem to be calling MPI_Init(), but it was created outside of MPI, wasn't it?",
+ self->get_cname());
+ ext->instance_id_ = id;
+ const int rank = static_cast<int>(xbt_str_parse_int(self->get_property("rank"), "Cannot parse rank"));