Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] fix tests: tracing-tasks and smpi-tracing-ptp
[simgrid.git] / examples / smpi / reduce.c
index 25ae108..2946edc 100644 (file)
@@ -24,7 +24,7 @@
  * ENHANCEMENTS, OR MODIFICATIONS.
  * ***************************************************************************
  **/
-int ibm_test(int rank, int size)
+static int ibm_test(int rank, int size)
 {
   int success = 1;
 #define MAXLEN  10000
@@ -43,8 +43,8 @@ int ibm_test(int rank, int size)
     if (rank == root) {
       for (k = 0; k < j; k++) {
         if (in[k] != k * size) {
-          printf("bad answer (%d) at index %d of %d (should be %d)", in[k], k,
-                 j, k * size);
+          printf("bad answer (%d) at index %d of %d (should be %d)", in[k],
+                 k, j, k * size);
           success = 0;
           break;
         }
@@ -79,9 +79,10 @@ int main(int argc, char **argv)
 
   value = rank + 1;             /* easy to verify that sum= (size*(size+1))/2; */
 
-  printf("[%d] has value %d\n", rank, value);
+  //printf("[%d] has value %d\n", rank, value);
   MPI_Reduce(&value, &sum, 1, MPI_INT, MPI_SUM, root, MPI_COMM_WORLD);
-  MPI_Reduce(&value, &sum_mirror, 1, MPI_INT, MPI_SUM, root, MPI_COMM_WORLD);
+  MPI_Reduce(&value, &sum_mirror, 1, MPI_INT, MPI_SUM, root,
+             MPI_COMM_WORLD);
 
   MPI_Reduce(&value, &min, 1, MPI_INT, MPI_MIN, root, MPI_COMM_WORLD);
   MPI_Reduce(&value, &max, 1, MPI_INT, MPI_MAX, root, MPI_COMM_WORLD);