Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
reduce the differences between the s4u_async examples
[simgrid.git] / src / smpi / mpi / smpi_group.cpp
index 2320768..a3b3446 100644 (file)
@@ -39,7 +39,7 @@ Group::Group(MPI_Group origin)
       rank_to_index_map_[i] = origin->rank_to_index_map_[i];
     }
 
-    for (auto elm : origin->index_to_rank_map_) {
+    for (auto const& elm : origin->index_to_rank_map_) {
       index_to_rank_map_.insert({elm.first, elm.second});
     }
   }
@@ -127,10 +127,8 @@ int Group::incl(int n, int* ranks, MPI_Group* newgroup)
     *newgroup = MPI_GROUP_EMPTY;
   } else if (n == size_) {
     *newgroup = this;
-    if(this!= MPI_COMM_WORLD->group()
-              && this != MPI_COMM_SELF->group()
-              && this != MPI_GROUP_EMPTY)
-    this->ref();
+    if (this != MPI_COMM_WORLD->group() && this != MPI_COMM_SELF->group() && this != MPI_GROUP_EMPTY)
+      this->ref();
   } else {
     *newgroup = new Group(n);
     for (i = 0; i < n; i++) {