Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
activate two tests in collective communications
[simgrid.git] / teshsuite / smpi / mpich3-test / coll / nonblocking.c
index f30d813..97cfa58 100644 (file)
 /* USE_STRICT_MPI may be defined in mpitestconf.h */
 #include "mpitestconf.h"
 
+#if !defined(USE_STRICT_MPI) && defined(MPICH)
+#define TEST_NBC_ROUTINES 1
+#endif
+
 #define NUM_INTS (2)
 
 #define my_assert(cond_)                                                  \
         if (!(cond_)) {                                                   \
             fprintf(stderr, "assertion (%s) failed, aborting\n", #cond_); \
             MPI_Abort(MPI_COMM_WORLD, 1);                                 \
+            exit(1);                                                      \
         }                                                                 \
     } while (0)
 
 int main(int argc, char **argv)
 {
     int errs = 0;
-    int i;
     int rank, size;
     int *sbuf = NULL;
     int *rbuf = NULL;
@@ -37,9 +41,12 @@ int main(int argc, char **argv)
     int *rcounts = NULL;
     int *sdispls = NULL;
     int *rdispls = NULL;
-    int *types = NULL;
     MPI_Comm comm;
+#if defined(TEST_NBC_ROUTINES)
+    int i;
+    int *types = NULL;
     MPI_Request req;
+#endif
 
     /* intentionally not using MTest_Init/MTest_Finalize in order to make it
      * easy to take this test and use it as an NBC sanity test outside of the
@@ -51,7 +58,7 @@ int main(int argc, char **argv)
     MPI_Comm_size(comm, &size);
     MPI_Comm_rank(comm, &rank);
 
-#if !defined(USE_STRICT_MPI) && defined(MPICH)
+#if defined(TEST_NBC_ROUTINES)
     /* enough space for every process to contribute at least NUM_INTS ints to any
      * collective operation */
     sbuf = malloc(NUM_INTS*size*sizeof(int));