Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
please sonar
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 13 Mar 2017 00:35:44 +0000 (01:35 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 13 Mar 2017 00:48:51 +0000 (01:48 +0100)
- remove redundent if conditions
- Initialize member "ndims_" in an initialization list.

src/smpi/smpi_base.cpp
src/smpi/smpi_pmpi.cpp
src/smpi/smpi_topo.cpp
src/smpi/smpi_topo.hpp

index 141d8e9..712fec3 100644 (file)
@@ -483,7 +483,7 @@ void smpi_mpi_exscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datat
           recvbuf_is_empty=0;
         } else
           // #Request is below rank: it's a irecv
           recvbuf_is_empty=0;
         } else
           // #Request is below rank: it's a irecv
-          if(op!=MPI_OP_NULL) op->apply( tmpbufs[index], recvbuf, &count, datatype);
+          op->apply(tmpbufs[index], recvbuf, &count, datatype);
       }
     }
   }else{
       }
     }
   }else{
index 5acaab9..6e89a6d 100644 (file)
@@ -1773,7 +1773,7 @@ int PMPI_Reduce_local(void *inbuf, void *inoutbuf, int count, MPI_Datatype datat
   if (!datatype->is_valid() || op == MPI_OP_NULL) {
     retval = MPI_ERR_ARG;
   } else {
   if (!datatype->is_valid() || op == MPI_OP_NULL) {
     retval = MPI_ERR_ARG;
   } else {
-    if(op!=MPI_OP_NULL) op->apply( inbuf, inoutbuf, &count, datatype);
+    op->apply(inbuf, inoutbuf, &count, datatype);
     retval = MPI_SUCCESS;
   }
   smpi_bench_begin();
     retval = MPI_SUCCESS;
   }
   smpi_bench_begin();
index 49a36a2..143efe0 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2014, 2017. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2014-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -43,10 +42,8 @@ Topo_Cart::~Topo_Cart()
   delete[] position_;
 }
 
   delete[] position_;
 }
 
-Topo_Cart::Topo_Cart(int ndims)
+Topo_Cart::Topo_Cart(int ndims) : ndims_(ndims)
 {
 {
-  nnodes_ = 0;
-  ndims_ = ndims;
   dims_ = new int[ndims];
   periodic_ = new int[ndims];
   position_ = new int[ndims];
   dims_ = new int[ndims];
   periodic_ = new int[ndims];
   position_ = new int[ndims];
index 7444794..6e421b4 100644 (file)
@@ -21,7 +21,7 @@ class Topo {
 
 class Topo_Cart: public Topo {
   private:
 
 class Topo_Cart: public Topo {
   private:
-    int nnodes_;
+    int nnodes_ = 0;
     int ndims_;
     int *dims_;
     int *periodic_;
     int ndims_;
     int *dims_;
     int *periodic_;