Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Upgrade coll mpich testlist to new mpich
[simgrid.git] / teshsuite / smpi / mpich3-test / coll / red_scat_block.c
index 3f35fb3..2884708 100644 (file)
 int main(int argc, char **argv)
 {
     int err = 0;
-    int toterr, size, rank;
-#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
-    int i, sumval;
+    int toterr, size, rank, i, sumval;
     int *sendbuf;
     int *recvbuf;
-#endif
     MPI_Comm comm;
 
     MPI_Init(&argc, &argv);
@@ -42,14 +39,13 @@ int main(int argc, char **argv)
         err++;
         fprintf(stderr, "unable to allocate send/recv buffers, aborting");
         MPI_Abort(MPI_COMM_WORLD, 1);
-        exit(1);
     }
-    for (i=0; i<size; i++)
+    for (i = 0; i < size; i++)
         sendbuf[i] = rank + i;
 
     MPI_Reduce_scatter_block(sendbuf, recvbuf, 1, MPI_INT, MPI_SUM, comm);
 
-    sumval = size * rank + ((size - 1) * size)/2;
+    sumval = size * rank + ((size - 1) * size) / 2;
     if (recvbuf[0] != sumval) {
         err++;
         fprintf(stdout, "Did not get expected value for reduce scatter block\n");
@@ -59,22 +55,17 @@ int main(int argc, char **argv)
     free(sendbuf);
 
     /* let's try it again with MPI_IN_PLACE this time */
-    for (i=0; i<size; i++)
+    for (i = 0; i < size; i++)
         recvbuf[i] = rank + i;
 
     MPI_Reduce_scatter_block(MPI_IN_PLACE, recvbuf, 1, MPI_INT, MPI_SUM, comm);
 
-    sumval = size * rank + ((size - 1) * size)/2;
+    sumval = size * rank + ((size - 1) * size) / 2;
     if (recvbuf[0] != sumval) {
         err++;
         fprintf(stdout, "Did not get expected value for reduce scatter block\n");
         fprintf(stdout, "[%d] Got %d expected %d\n", rank, recvbuf[0], sumval);
     }
-
-    MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
-    if (MPI_SUCCESS == MPI_Reduce_scatter_block(recvbuf, recvbuf, 1, MPI_INT, MPI_SUM, comm))
-        err++;
-
     free(recvbuf);
 #endif