Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
functioning MPI_Comm_get_name, MPI_Comm_set_name
[simgrid.git] / teshsuite / smpi / mpich3-test / comm / comm_idup.c
index 1a56bd6..7958012 100644 (file)
 #include "mpi.h"
 #include "mpitest.h"
 
-/* This is a temporary #ifdef to control whether we test this functionality.  A
- * configure-test or similar would be better.  Eventually the MPI-3 standard
- * will be released and this can be gated on a MPI_VERSION check */
-#if !defined(USE_STRICT_MPI) && defined(MPICH)
-#define TEST_IDUP 1
-#endif
-
 /* assert-like macro that bumps the err count and emits a message */
 #define check(x_)                                                                 \
     do {                                                                          \
@@ -45,11 +38,8 @@ int main(int argc, char **argv)
     if (size < 2) {
         printf("this test requires at least 2 processes\n");
         MPI_Abort(MPI_COMM_WORLD, 1);
-        exit(1);
     }
 
-#ifdef TEST_IDUP
-
     /* test plan: make rank 0 wait in a blocking recv until all other processes
      * have posted their MPI_Comm_idup ops, then post last.  Should ensure that
      * idup doesn't block on the non-zero ranks, otherwise we'll get a deadlock.
@@ -76,7 +66,7 @@ int main(int argc, char **argv)
     buf[0] = rank;
     buf[1] = 0xfeedface;
     MPI_Allreduce(&buf[0], &buf[1], 1, MPI_INT, MPI_SUM, newcomm);
-    check(buf[1] == (size * (size-1) / 2));
+    check(buf[1] == (size * (size - 1) / 2));
 
     MPI_Comm_free(&newcomm);
 
@@ -119,7 +109,7 @@ int main(int argc, char **argv)
     buf[0] = lrank;
     buf[1] = 0xfeedface;
     MPI_Allreduce(&buf[0], &buf[1], 1, MPI_INT, MPI_SUM, newcomm);
-    check(buf[1] == (rsize * (rsize-1) / 2));
+    check(buf[1] == (rsize * (rsize - 1) / 2));
 
     /* free this down here, not before idup, otherwise it will undo our
      * stagger_comm work */
@@ -131,8 +121,6 @@ int main(int argc, char **argv)
     MPI_Comm_free(&newcomm);
     MPI_Comm_free(&ic);
 
-#endif /* TEST_IDUP */
-
     MPI_Reduce((rank == 0 ? MPI_IN_PLACE : &errs), &errs, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
     if (rank == 0) {
         if (errs) {
@@ -147,4 +135,3 @@ int main(int argc, char **argv)
 
     return 0;
 }
-