- // FIXME: should kill all processes in comm instead
- XBT_WARN("MPI_Abort was called, something went probably wrong in this simulation ! Killing this process");
- smx_actor_t actor = SIMIX_process_self();
- simgrid::kernel::actor::simcall([actor] { actor->exit(); });
+ CHECK_COMM(1)
+ XBT_WARN("MPI_Abort was called, something went probably wrong in this simulation ! Killing all processes sharing the same MPI_COMM_WORLD");
+ auto* myself = simgrid::kernel::actor::ActorImpl::self();
+ for (int i = 0; i < comm->size(); i++){
+ auto* actor = simgrid::kernel::EngineImpl::get_instance()->get_actor_by_pid(comm->group()->actor(i));
+ if (actor != nullptr && actor != myself)
+ simgrid::kernel::actor::simcall_answered([actor] { actor->exit(); });
+ }
+ // now ourself
+ simgrid::kernel::actor::simcall_answered([myself] { myself->exit(); });