Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SMPI] Remove local variable sz in smpi_group.cpp
authorChristian Heinrich <franz-christian.heinrich@inria.fr>
Fri, 15 Dec 2017 13:47:55 +0000 (14:47 +0100)
committerChristian Heinrich <franz-christian.heinrich@inria.fr>
Fri, 12 Jan 2018 00:08:32 +0000 (01:08 +0100)
We already tested before if size_ != group2->size() -- and since
sz = group2->size(), we have here size_ == sz. So just use size_.

src/smpi/mpi/smpi_group.cpp

index 4506de6..89fbf59 100644 (file)
@@ -95,8 +95,7 @@ int Group::compare(MPI_Group group2)
   if (size_ != group2->size()) {
     result = MPI_UNEQUAL;
   } else {
-    int sz = group2->size();
-    for (int i = 0; i < sz; i++) {
+    for (int i = 0; i < size_; i++) {
       int index = this->index(i);
       int rank = group2->rank(index);
       if (rank == MPI_UNDEFINED) {