Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
please sonar in various trivial ways
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 6 Apr 2019 11:48:37 +0000 (13:48 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 6 Apr 2019 11:48:37 +0000 (13:48 +0200)
src/smpi/bindings/smpi_pmpi_coll.cpp
teshsuite/smpi/privatization/privatization.c
teshsuite/smpi/pt2pt-dsend/pt2pt-dsend.c
teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.c

index 415f126..09324ed 100644 (file)
@@ -417,7 +417,7 @@ int PMPI_Ireduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
 {
   if (comm == MPI_COMM_NULL) {
     return MPI_ERR_COMM;
-  } if ((sendbuf == nullptr && count > 0) || ((comm->rank() == root) && recvbuf == nullptr)) {
+  } else if ((sendbuf == nullptr && count > 0) || ((comm->rank() == root) && recvbuf == nullptr)) {
     return MPI_ERR_BUFFER;
   } else if (datatype == MPI_DATATYPE_NULL || not datatype->is_valid()){
     return MPI_ERR_TYPE;
@@ -475,7 +475,7 @@ int PMPI_Iallreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype dataty
 {
   if (comm == MPI_COMM_NULL) {
     return MPI_ERR_COMM;
-  } if ((sendbuf == nullptr && count > 0) || (recvbuf == nullptr)) {
+  } else if ((sendbuf == nullptr && count > 0) || (recvbuf == nullptr)) {
     return MPI_ERR_BUFFER;
   } else if (datatype == MPI_DATATYPE_NULL || not datatype->is_valid()) {
     return MPI_ERR_TYPE;
index 9a9e963..25668c8 100644 (file)
@@ -6,7 +6,8 @@
 
 static int myvalue = 0;
 static void test_opts(int* argc, char **argv[]){
-  int found = 0, ret;
+  int found = 0;
+  int ret;
   static struct option long_options[] = {
   {"long",     no_argument, 0,  0 },
   {0,         0,                 0,  0 }
index b2fbc21..84217e9 100644 (file)
@@ -12,7 +12,8 @@
 XBT_LOG_NEW_DEFAULT_CATEGORY(dsend,"the dsend test");
 
 static void test_opts(int* argc, char **argv[]){
-  int found = 0, ret;
+  int found = 0;
+  int ret;
   int option_index = 0;
   static struct option long_options[] = {
   {"long",     no_argument, 0,  0 },
index 6ddb623..c46ea33 100644 (file)
 #include <mpi.h>
 
 static void test_opts(int* argc, char **argv[]){
-  int found = 0, ret;
+  int found = 0;
+  int ret;
   while ((ret = getopt(*argc, *argv, "s")) >= 0)
   {
-    switch (ret) {
-    case 's':
+    if (ret == 's')
       found = 1;
-      break;
-    }
   }
   if (found!=1){
     printf("(smpi_)getopt failed ! \n");