Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge if statements.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 18 Oct 2017 14:50:59 +0000 (16:50 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 18 Oct 2017 17:22:10 +0000 (19:22 +0200)
src/xbt/graph.c
teshsuite/smpi/coll-allgather/coll-allgather.c
teshsuite/smpi/coll-allgatherv/coll-allgatherv.c
teshsuite/smpi/coll-allreduce/coll-allreduce.c
teshsuite/smpi/coll-alltoall/coll-alltoall.c
teshsuite/smpi/coll-bcast/coll-bcast.c

index b82a581..b5f95c6 100644 (file)
@@ -226,11 +226,10 @@ void xbt_floyd_algorithm(xbt_graph_t g, double *adj, double *d, xbt_node_t * p)
   for (k = 0; k < n; k++) {
     for (i = 0; i < n; i++) {
       for (j = 0; j < n; j++) {
-        if ((d[i*n+k] > -1) && (d[k*n+j] > -1)) {
-          if ((d[i*n+j] < 0) || (d[i*n+j] > d[i*n+k] + d[k*n+j])) {
-            d[i*n+j] = d[i*n+k] + d[k*n+j];
-            p[i*n+j] = p[k*n+j];
-          }
+        if (d[i * n + k] > -1 && d[k * n + j] > -1 &&
+            (d[i * n + j] < 0 || d[i * n + j] > d[i * n + k] + d[k * n + j])) {
+          d[i * n + j] = d[i * n + k] + d[k * n + j];
+          p[i * n + j] = p[k * n + j];
         }
       }
     }
index 68cfc76..83ba94a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2010, 2013-2014. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2013-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -46,11 +46,9 @@ int main(int argc, char *argv[])
     printf("%d ", rb[i]);
   printf("]\n");
 
-  if (rank == 0) {
-    if (status != MPI_SUCCESS) {
-      printf("allgather returned %d\n", status);
-      fflush(stdout);
-    }
+  if (rank == 0 && status != MPI_SUCCESS) {
+    printf("allgather returned %d\n", status);
+    fflush(stdout);
   }
   xbt_free(sb);
   xbt_free(rb);
index 30734f1..7e2f35e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2010, 2013-2014. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2013-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -56,11 +56,9 @@ int main(int argc, char *argv[])
     printf("%d ", rb[i]);
   printf("]\n");
 
-  if (rank == 0) {
-    if (status != MPI_SUCCESS) {
-      printf("allgatherv returned %d\n", status);
-      fflush(stdout);
-    }
+  if (rank == 0 && status != MPI_SUCCESS) {
+    printf("allgatherv returned %d\n", status);
+    fflush(stdout);
   }
   xbt_free(sb);
   xbt_free(rb);
index 509aec9..c35732f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2010, 2013-2014. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2013-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -50,11 +50,9 @@ int main(int argc, char *argv[])
     printf("%d ", rb[i]);
   printf("]\n");
 
-  if (rank == 0) {
-    if (status != MPI_SUCCESS) {
-      printf("all_to_all returned %d\n", status);
-      fflush(stdout);
-    }
+  if (rank == 0 && status != MPI_SUCCESS) {
+    printf("all_to_all returned %d\n", status);
+    fflush(stdout);
   }
   xbt_free(sb);
   xbt_free(rb);
index 1bbcf69..da76146 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2010, 2013-2014. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2013-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -46,11 +46,9 @@ int main(int argc, char *argv[])
     printf("%d ", rb[i]);
   printf("]\n");
 
-  if (rank == 0) {
-    if (status != MPI_SUCCESS) {
-      printf("all_to_all returned %d\n", status);
-      fflush(stdout);
-    }
+  if (rank == 0 && status != MPI_SUCCESS) {
+    printf("all_to_all returned %d\n", status);
+    fflush(stdout);
   }
   xbt_free(sb);
   xbt_free(rb);
index e8aeaec..a53771a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2013-2014. The SimGrid Team.
+/* Copyright (c) 2009, 2013-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -46,11 +46,9 @@ int main(int argc, char **argv)
     if (values[i]==17) good++;
   printf("[%d] number of values equals to 17: %d\n", rank, good);
 
-  if (rank == 0) {
-    if (status != MPI_SUCCESS) {
-      printf("bcast returned %d\n", status);
-      fflush(stdout);
-    }
+  if (rank == 0 && status != MPI_SUCCESS) {
+    printf("bcast returned %d\n", status);
+    fflush(stdout);
   }
   xbt_free(values);
   MPI_Finalize();