Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Sonar polishing.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sat, 17 Apr 2021 09:21:27 +0000 (11:21 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sat, 17 Apr 2021 09:21:45 +0000 (11:21 +0200)
src/kernel/routing/StarZone_test.cpp
src/smpi/mpi/smpi_comm.cpp
src/smpi/mpi/smpi_topo.cpp

index e5ba37e..46126ba 100644 (file)
@@ -21,7 +21,7 @@ class EngineWrapper {
   simgrid::s4u::Engine e;
 
 public:
-  EngineWrapper(std::string name) : argv(&name[0]), e(&argc, &argv) {}
+  explicit EngineWrapper(std::string name) : argv(&name[0]), e(&argc, &argv) {}
 };
 } // namespace
 
index d07017c..cc1257b 100644 (file)
@@ -262,7 +262,7 @@ MPI_Comm Comm::split(int color, int key)
 
   MPI_Group group_root = nullptr;
   MPI_Group group_out  = nullptr;
-  MPI_Group group      = this->group();
+  const Group* group   = this->group();
   int myrank           = this->rank();
   int size             = this->size();
   /* Gather all colors and keys on rank 0 */
index 5f28d6f..31864fb 100644 (file)
@@ -38,9 +38,6 @@ Topo_Cart::Topo_Cart(int ndims) : ndims_(ndims), dims_(ndims), periodic_(ndims),
 Topo_Cart::Topo_Cart(MPI_Comm comm_old, int ndims, const int dims[], const int periods[], int /*reorder*/, MPI_Comm* comm_cart)
     : Topo_Cart(ndims)
 {
-  MPI_Group newGroup;
-  MPI_Group oldGroup;
-
   int rank = comm_old->rank();
 
   if(ndims != 0) {
@@ -68,8 +65,8 @@ Topo_Cart::Topo_Cart(MPI_Comm comm_old, int ndims, const int dims[], const int p
     }
     
     if(comm_cart != nullptr){
-      oldGroup = comm_old->group();
-      newGroup = new  Group(newSize);
+      const Group* oldGroup = comm_old->group();
+      auto* newGroup        = new Group(newSize);
       for (int i = 0 ; i < newSize ; i++) {
         newGroup->set_mapping(oldGroup->actor(i), i);
       }