Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
further refactoring
[simgrid.git] / teshsuite / smpi / coll-scatter / coll-scatter.c
similarity index 87%
rename from teshsuite/smpi/scatter/scatter.c
rename to teshsuite/smpi/coll-scatter/coll-scatter.c
index 94d88d3..268b38c 100644 (file)
@@ -25,7 +25,6 @@
  * PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS AND IBM
  * CORP. HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
  * ENHANCEMENTS, OR MODIFICATIONS.
- * ***************************************************************************
  **/
 #include <stdio.h>
 #include <mpi.h>
@@ -41,7 +40,6 @@ static int ibm_test(int rank, int size)
   int *out;
   int *in;
 
-
   out = malloc(MAXLEN * 64 * sizeof(int));
   in = malloc(MAXLEN * sizeof(int));
 
@@ -55,9 +53,7 @@ static int ibm_test(int rank, int size)
 
     for (k = 0; k < j; k++) {
       if (in[k] != k + rank * j) {
-        fprintf(stderr,
-                "task %d bad answer (%d) at index %d k of %d (should be %d)",
-                rank, in[k], k, j, (k + rank * j));
+        fprintf(stderr, "task %d bad answer (%d) at index %d k of %d (should be %d)",rank, in[k], k, j, (k + rank * j));
         return (0);
       }
     }
@@ -68,9 +64,7 @@ static int ibm_test(int rank, int size)
   return (success);
 }
 
-/**
- * small test: the root sends a single distinct double to other processes
- **/
+/** small test: the root sends a single distinct double to other processes */
 static int small_test(int rank, int size)
 {
   int success = 1;
@@ -90,15 +84,12 @@ static int small_test(int rank, int size)
     }
   }
 
-  retval =
-      MPI_Scatter(sndbuf, sendcount, MPI_DOUBLE, &rcvd, recvcount,
-                  MPI_DOUBLE, root, MPI_COMM_WORLD);
+  retval = MPI_Scatter(sndbuf, sendcount, MPI_DOUBLE, &rcvd, recvcount, MPI_DOUBLE, root, MPI_COMM_WORLD);
   if (root == rank) {
     free(sndbuf);
     }
   if (retval != MPI_SUCCESS) {
-    fprintf(stderr, "(%s:%d) MPI_Scatter() returned retval=%d\n", __FILE__,
-            __LINE__, retval);
+    fprintf(stderr, "(%s:%d) MPI_Scatter() returned retval=%d\n", __FILE__, __LINE__, retval);
     return 0;
   }
   // verification
@@ -109,13 +100,10 @@ static int small_test(int rank, int size)
   return (success);
 }
 
-
-
 int main(int argc, char **argv)
 {
   int size, rank;
 
-
   MPI_Init(&argc, &argv);
   MPI_Comm_size(MPI_COMM_WORLD, &size);
   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
@@ -128,7 +116,6 @@ int main(int argc, char **argv)
   else
     printf("\t[%d] ok.\n", rank);
 
-
   MPI_Barrier(MPI_COMM_WORLD);
 
   /* test 2 */