- //get the indexes of all processes sharing the same simix host
- xbt_swag_t process_list = sg_host_self()->extension<simgrid::simix::Host>()->process_list;
- int intra_comm_size = 0;
- int min_index = INT_MAX; // the minimum index will be the leader
- smx_actor_t actor = nullptr;
- xbt_swag_foreach(actor, process_list)
- {
- int index = actor->pid - 1;
-
- if (this->group()->rank(index) != MPI_UNDEFINED) {
- intra_comm_size++;
- // the process is in the comm
- if (index < min_index)
- min_index = index;
- }
+ //get the indices of all processes sharing the same simix host
+ auto& process_list = sg_host_self()->extension<simgrid::simix::Host>()->process_list;
+ int intra_comm_size = 0;
+ int min_index = INT_MAX; // the minimum index will be the leader
+ for (auto& actor : process_list) {
+ int index = actor.pid;
+ if (this->group()->rank(actor.iface()) != MPI_UNDEFINED) { // Is this process in the current group?
+ intra_comm_size++;
+ if (index < min_index)
+ min_index = index;
+ }