Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
update collectives teshsuite from mpich git (only minor changes)
[simgrid.git] / teshsuite / smpi / mpich3-test / coll / nonblocking2.c
index e607fad..6dac34b 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 /* A basic test of all 17 nonblocking collective operations specified by the
- * draft MPI-3 standard.  It only exercises the intracommunicator functionality,
+ * MPI-3 standard.  It only exercises the intracommunicator functionality,
  * does not use MPI_IN_PLACE, and only transmits/receives simple integer types
  * with relatively small counts.  It does check a few fancier issues, such as
  * ensuring that "premature user releases" of MPI_Op and MPI_Datatype objects
@@ -14,8 +14,6 @@
 #include "mpi.h"
 #include <stdlib.h>
 #include <stdio.h>
-/* USE_STRICT_MPI may be defined in mpitestconf.h */
-#include "mpitestconf.h"
 
 #define COUNT (10)
 #define PRIME (17)
         }                                                                 \
     } while (0)
 
-/* Since MPICH is currently the only NBC implementation in existence, just use
- * this quick-and-dirty #ifdef to decide whether to test the nonblocking
- * collectives.  Eventually we can add a configure option or configure test, or
- * the MPI-3 standard will be released and these can be gated on a MPI_VERSION
- * check */
-#if !defined(USE_STRICT_MPI) && defined(MPICH)
-#define TEST_NBC_ROUTINES 1
-#endif
-
 static void sum_fn(void *invec, void *inoutvec, int *len, MPI_Datatype *datatype)
 {
     int i;
@@ -51,6 +40,7 @@ static void sum_fn(void *invec, void *inoutvec, int *len, MPI_Datatype *datatype
 
 int main(int argc, char **argv)
 {
+    int i, j;
     int rank, size;
     int *buf = NULL;
     int *recvbuf = NULL;
@@ -60,16 +50,12 @@ int main(int argc, char **argv)
     int *rdispls = NULL;
     int *sendtypes = NULL;
     int *recvtypes = NULL;
-#if defined(TEST_NBC_ROUTINES)
-    int i, j;
-    char *buf_alias = NULL;
+    signed char *buf_alias = NULL;
     MPI_Request req;
-#endif
 
     MPI_Init(&argc, &argv);
     MPI_Comm_rank(MPI_COMM_WORLD, &rank);
     MPI_Comm_size(MPI_COMM_WORLD, &size);
-#if defined(TEST_NBC_ROUTINES)
 
     buf        = malloc(COUNT*size*sizeof(int));
     recvbuf    = malloc(COUNT*size*sizeof(int));
@@ -99,7 +85,7 @@ int main(int argc, char **argv)
     }
 
     /* MPI_Ibcast (again, but designed to stress scatter/allgather impls) */
-    buf_alias = (char *)buf;
+    buf_alias = (signed char *)buf;
     my_assert(COUNT*size*sizeof(int) > PRIME); /* sanity */
     for (i = 0; i < PRIME; ++i) {
         if (rank == 0)
@@ -110,7 +96,7 @@ int main(int argc, char **argv)
     for (i = PRIME; i < COUNT * size * sizeof(int); ++i) {
         buf_alias[i] = 0xbf;
     }
-    MPI_Ibcast(buf, PRIME, MPI_SIGNED_CHAR, 0, MPI_COMM_WORLD, &req);
+    MPI_Ibcast(buf_alias, PRIME, MPI_SIGNED_CHAR, 0, MPI_COMM_WORLD, &req);
     MPI_Wait(&req, MPI_STATUS_IGNORE);
     for (i = 0; i < PRIME; ++i) {
         if (buf_alias[i] != i)
@@ -451,8 +437,6 @@ int main(int argc, char **argv)
         }
     }
 
-#endif /* defined(TEST_NBC_ROUTINES) */
-
     if (rank == 0)
         printf(" No Errors\n");