Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename SIMIX_host_self() into sg_host_self(), and make it public
[simgrid.git] / src / smpi / smpi_comm.cpp
index f128f59..d5ac71c 100644 (file)
@@ -333,19 +333,20 @@ void Comm::init_smp(){
    }
   //identify neighbours in comm
   //get the indexes of all processes sharing the same simix host
-  xbt_swag_t process_list = SIMIX_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;
-    }
+   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;
+     }
   }
   XBT_DEBUG("number of processes deployed on my node : %d", intra_comm_size);
   MPI_Group group_intra = new  Group(intra_comm_size);