Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix warnings about unused variables in mpich3-test.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 12 Sep 2013 11:52:30 +0000 (13:52 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Fri, 13 Sep 2013 15:16:01 +0000 (17:16 +0200)
20 files changed:
teshsuite/smpi/mpich3-test/coll/iallred.c
teshsuite/smpi/mpich3-test/coll/ibarrier.c
teshsuite/smpi/mpich3-test/coll/icbarrier.c
teshsuite/smpi/mpich3-test/coll/nonblocking.c
teshsuite/smpi/mpich3-test/coll/nonblocking2.c
teshsuite/smpi/mpich3-test/coll/nonblocking3.c
teshsuite/smpi/mpich3-test/coll/op_commutative.c
teshsuite/smpi/mpich3-test/coll/red_scat_block.c
teshsuite/smpi/mpich3-test/coll/red_scat_block2.c
teshsuite/smpi/mpich3-test/coll/reduce_local.c
teshsuite/smpi/mpich3-test/datatype/darray-cyclic.c
teshsuite/smpi/mpich3-test/datatype/hindexed_block.c
teshsuite/smpi/mpich3-test/datatype/large-count.c
teshsuite/smpi/mpich3-test/datatype/simple-pack-external.c
teshsuite/smpi/mpich3-test/datatype/simple-pack.c
teshsuite/smpi/mpich3-test/datatype/transpose-pack.c
teshsuite/smpi/mpich3-test/pt2pt/large_message.c
teshsuite/smpi/mpich3-test/pt2pt/mprobe.c
teshsuite/smpi/mpich3-test/pt2pt/pscancel.c
teshsuite/smpi/mpich3-test/pt2pt/scancel.c

index f06b492..564a47f 100644 (file)
 
 int main(int argc, char *argv[])
 {
-    MPI_Request request;
     int size, rank;
+#if defined(TEST_NBC_ROUTINES)
+    MPI_Request request;
     int one = 1, two = 2, isum, sum;
+#endif
     MPI_Init(&argc,&argv);
     MPI_Comm_size(MPI_COMM_WORLD, &size);
     MPI_Comm_rank(MPI_COMM_WORLD, &rank);
index bf2508b..44d6703 100644 (file)
 
 int main(int argc, char *argv[])
 {
+#if defined(TEST_NBC_ROUTINES)
     MPI_Request barrier;
-    int rank,i,done;
+    int i,done;
+#endif
+    int rank;
 
     MPI_Init(&argc,&argv);
     MPI_Comm_rank(MPI_COMM_WORLD,&rank);
-    #if defined(TEST_NBC_ROUTINES)
+#if defined(TEST_NBC_ROUTINES)
     MPI_Ibarrier(MPI_COMM_WORLD,&barrier);
     for (i=0,done=0; !done; i++) {
         usleep(1000);
         /*printf("[%d] MPI_Test: %d\n",rank,i);*/
         MPI_Test(&barrier,&done,MPI_STATUS_IGNORE);
     }
-    #endif
+#endif
     if (rank == 0)
         printf(" No Errors\n");
 
index 94adbc4..b2d022a 100644 (file)
@@ -22,11 +22,11 @@ int main( int argc, char *argv[] )
     int errs = 0, err;
     int leftGroup;
     MPI_Comm comm;
-    MPI_Datatype datatype;
+    /* MPI_Datatype datatype; */
 
     MTest_Init( &argc, &argv );
 
-    datatype = MPI_INT;
+    /* datatype = MPI_INT; */
     /* Get an intercommunicator */
     while (MTestGetIntercomm( &comm, &leftGroup, 4 )) {
         if (comm == MPI_COMM_NULL)
index f30d813..8f49a99 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_)                                                  \
@@ -29,7 +33,6 @@
 int main(int argc, char **argv)
 {
     int errs = 0;
-    int i;
     int rank, size;
     int *sbuf = NULL;
     int *rbuf = NULL;
@@ -37,9 +40,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 +57,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));
index a323596..bc8a2c2 100644 (file)
@@ -50,7 +50,6 @@ 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,8 +59,11 @@ 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;
     MPI_Request req;
+#endif
 
     MPI_Init(&argc, &argv);
     MPI_Comm_rank(MPI_COMM_WORLD, &rank);
index e072def..2c0ab32 100644 (file)
@@ -749,18 +749,18 @@ static void complete_something_somehow(unsigned int rndnum, int numreqs, MPI_Req
 
 int main(int argc, char **argv)
 {
-    int i, num_posted, num_completed;
     int wrank, wsize;
+#if defined(TEST_NBC_ROUTINES)
+    int i, num_posted, num_completed;
     unsigned int seed = 0x10bc;
     unsigned int post_seq, complete_seq;
-#if defined(TEST_NBC_ROUTINES)
     struct laundry larr[WINDOW];
-#endif
     MPI_Request reqs[WINDOW];
     int outcount;
     int indices[WINDOW];
     MPI_Comm comms[NUM_COMMS];
     MPI_Comm comm;
+#endif
 
     MPI_Init(&argc, &argv);
     MPI_Comm_rank(MPI_COMM_WORLD, &wrank);
index cc2b80a..28043ef 100644 (file)
@@ -51,7 +51,9 @@ int main( int argc, char *argv[] )
 {
     MPI_Op c_uop = MPI_OP_NULL;
     MPI_Op nc_uop = MPI_OP_NULL;
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
     int is_commutative = 0;
+#endif
 
     MTest_Init(&argc, &argv);
 
index 3092c8d..7891cb6 100644 (file)
 int main(int argc, char **argv)
 {
     int err = 0;
-    int toterr, size, rank, i, sumval;
+    int toterr, size, rank;
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
+    int i, sumval;
     int *sendbuf;
     int *recvbuf;
+#endif
     MPI_Comm comm;
 
     MPI_Init(&argc, &argv);
index 5346905..e98273b 100644 (file)
@@ -70,12 +70,15 @@ void nc_sum(void *a, void *b, int *count, MPI_Datatype *type)
 
 int main( int argc, char **argv )
 {
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
     int      *sendbuf;
     int      block_size;
     int      *recvbuf;
-    int      size, rank, i;
-    MPI_Comm comm;
+    int      i;
     MPI_Op left_op, right_op, nc_sum_op;
+#endif
+    int      size, rank;
+    MPI_Comm comm;
 
     MTest_Init( &argc, &argv );
     comm = MPI_COMM_WORLD;
index 9bf6820..6521bb7 100644 (file)
@@ -40,11 +40,13 @@ static void user_op(void *invec, void *inoutvec, int *len, MPI_Datatype *datatyp
 int main( int argc, char *argv[] )
 {
     int errs = 0;
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
     int i;
     int *inbuf = NULL;
     int *inoutbuf = NULL;
     int count = -1;
     MPI_Op uop = MPI_OP_NULL;
+#endif
 
     MTest_Init(&argc, &argv);
 #if MTEST_HAVE_MIN_MPI_VERSION(2,2)
index 947ec32..90eea4a 100644 (file)
@@ -207,7 +207,7 @@ int main( int argc, char *argv[] )
 int AllocateGrid( int nx, int ny, int **srcArray, int **destArray )
 {
     int *src, *dest;
-    int i, j;
+    int i;
     src = (int *)malloc( nx*ny*sizeof(int) );
     dest = (int *)malloc( nx*ny*sizeof(int) );
     if (!src || !dest) {
index da3fccd..23f8f62 100644 (file)
@@ -15,7 +15,9 @@
 #define TEST_HINDEXED_BLOCK 1
 #endif
 
+#if defined(TEST_HINDEXED_BLOCK)
 static int verbose = 0;
+#endif
 
 /* tests */
 int hindexed_block_contig_test(void);
@@ -27,7 +29,10 @@ static int pack_and_unpack(char *typebuf, int count, MPI_Datatype datatype, int
 
 int main(int argc, char **argv)
 {
-    int err, errs = 0;
+#if defined(TEST_HINDEXED_BLOCK)
+    int err;
+#endif
+    int errs = 0;
     int rank;
 
     MPI_Init(&argc, &argv);     /* MPI-1.2 doesn't allow for MPI_Init(0,0) */
index a272f4f..31f6a2d 100644 (file)
         }                                                                         \
     } while (0)
 
+/* Abort when using unimplemented functions.  Currently, it should not happen,
+ * since sizeof(MPI_Count) == sizeof(int), but it avoids compile errors about
+ * undefined functions. */
+#define err_unimpl(func) do {                                 \
+    fprintf(stderr, "ERROR: %s is not implemented\n", #func); \
+    abort();                                                  \
+  } while (0)
+
+#define MPI_Type_size_x(a,b)              err_unimpl(MPI_Type_size_x)
+#define MPI_Type_get_extent_x(a,b,c)      err_unimpl(MPI_Type_get_extent_x)
+#define MPI_Type_get_true_extent_x(a,b,c) err_unimpl(MPI_Type_get_true_extent_x)
+#define MPI_Get_elements_x(a,b,c)         err_unimpl(MPI_Get_elements_x)
+#define MPI_Status_set_elements_x(a,b,c)  err_unimpl(MPI_Status_set_elements_x)
+
 int main(int argc, char *argv[])
 {
     int errs = 0;
index 43f421c..6465944 100644 (file)
@@ -68,9 +68,9 @@ int builtin_float_test(void)
 {
     int nints, nadds, ntypes, combiner;
 
-    int err, errs = 0;
+    int /* err, */ errs = 0;
 
-    err = MPI_Type_get_envelope(MPI_FLOAT,
+    /* err = */ MPI_Type_get_envelope(MPI_FLOAT,
                                &nints,
                                &nadds,
                                &ntypes,
@@ -219,7 +219,7 @@ int optimizable_vector_of_basics_test(void)
     int i;
     MPI_Aint sizeofint, sizeoftype, position;
 
-    int err, errs = 0;
+    int /* err, */ errs = 0;
 
     MPI_Pack_external_size((char*)"external32", 1, MPI_INT, &sizeofint);
 
@@ -231,7 +231,7 @@ int optimizable_vector_of_basics_test(void)
     }
 
     /* set up type */
-    err = MPI_Type_vector(10,
+    /* err = */ MPI_Type_vector(10,
                          2,
                          2,
                          MPI_INT,
@@ -251,7 +251,7 @@ int optimizable_vector_of_basics_test(void)
     buf = (char *) malloc(sizeoftype);
 
     position = 0;
-    err = MPI_Pack_external((char*)"external32",
+    /* err = */ MPI_Pack_external((char*)"external32",
                            array,
                            1,
                            parent_type,
@@ -267,7 +267,7 @@ int optimizable_vector_of_basics_test(void)
 
     memset(array, 0, 20 * sizeof(int));
     position = 0;
-    err = MPI_Unpack_external((char*)"external32",
+    /* err = */ MPI_Unpack_external((char*)"external32",
                              buf,
                              sizeoftype,
                              &position,
@@ -313,7 +313,7 @@ int struct_of_basics_test(void)
     MPI_Aint indices[10];
     MPI_Datatype types[10];
 
-    int err, errs = 0;
+    int /* err, */ errs = 0;
 
     MPI_Pack_external_size((char*)"external32", 1, MPI_INT, &sizeofint);
 
@@ -333,7 +333,7 @@ int struct_of_basics_test(void)
     }
 
     /* set up type */
-    err = MPI_Type_struct(10,
+    /* err = */ MPI_Type_struct(10,
                          blocks,
                          indices,
                          types,
@@ -352,7 +352,7 @@ int struct_of_basics_test(void)
     buf = (char *) malloc(sizeoftype);
 
     position = 0;
-    err = MPI_Pack_external((char*)"external32",
+    /* err = */ MPI_Pack_external((char*)"external32",
                            array,
                            1,
                            parent_type,
@@ -368,7 +368,7 @@ int struct_of_basics_test(void)
 
     memset(array, 0, 20 * sizeof(int));
     position = 0;
-    err = MPI_Unpack_external((char*)"external32",
+    /* err = */ MPI_Unpack_external((char*)"external32",
                              buf,
                              sizeoftype,
                              &position,
index d2119cd..6e7b244 100644 (file)
@@ -69,9 +69,9 @@ int builtin_float_test(void)
 {
     int nints, nadds, ntypes, combiner;
 
-    int err, errs = 0;
+    int /* err, */ errs = 0;
 
-    err = MPI_Type_get_envelope(MPI_FLOAT,
+    /* err = */ MPI_Type_get_envelope(MPI_FLOAT,
                                &nints,
                                &nadds,
                                &ntypes,
@@ -217,7 +217,7 @@ int optimizable_vector_of_basics_test(void)
     char *buf;
     int i, sizeofint, sizeoftype, position;
 
-    int err, errs = 0;
+    int /* err, */ errs = 0;
 
     MPI_Type_size(MPI_INT, &sizeofint);
 
@@ -228,7 +228,7 @@ int optimizable_vector_of_basics_test(void)
     }
 
     /* set up type */
-    err = MPI_Type_vector(10,
+    /* err = */ MPI_Type_vector(10,
                          2,
                          2,
                          MPI_INT,
@@ -247,7 +247,7 @@ int optimizable_vector_of_basics_test(void)
     buf = (char *) malloc(sizeoftype);
 
     position = 0;
-    err = MPI_Pack(array,
+    /* err = */ MPI_Pack(array,
                   1,
                   parent_type,
                   buf,
@@ -263,7 +263,7 @@ int optimizable_vector_of_basics_test(void)
 
     memset(array, 0, 20 * sizeof(int));
     position = 0;
-    err = MPI_Unpack(buf,
+    /* err = */ MPI_Unpack(buf,
                     sizeoftype,
                     &position,
                     array,
index 5bd6a72..1cd2202 100644 (file)
@@ -25,7 +25,7 @@ int main(int argc, char *argv[])
     MPI_Datatype row, xpose;
     MPI_Aint sizeofint;
        
-    int err, errs = 0;
+    int /* err, */ errs = 0;
     int bufsize, position = 0;
     void *buffer;
   
@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
        change the error handler to errors return */
     MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
 
-    err = MPI_Pack(a,
+    /* err = */ MPI_Pack(a,
                   1,
                   xpose,
                   buffer,
@@ -68,7 +68,7 @@ int main(int argc, char *argv[])
        
     /* Unpack the buffer into b. */
     position = 0;
-    err = MPI_Unpack(buffer,
+    /* err = */ MPI_Unpack(buffer,
                     bufsize,
                     &position,
                     b,
index db3d275..b8a6d09 100644 (file)
@@ -13,7 +13,7 @@
 
 int main(int argc, char *argv[]) 
 {
-  int        ierr,i,size,rank;
+  int        /* ierr, */ i,size,rank;
   int        cnt = 270000000;
   MPI_Status status;
   long long  *cols;
@@ -29,8 +29,8 @@ int main(int argc, char *argv[])
       return 0;
   }
 
-  ierr = MPI_Comm_size(MPI_COMM_WORLD,&size);
-  ierr = MPI_Comm_rank(MPI_COMM_WORLD,&rank);
+  /* ierr = */ MPI_Comm_size(MPI_COMM_WORLD,&size);
+  /* ierr = */ MPI_Comm_rank(MPI_COMM_WORLD,&rank);
   if (size != 3) {
     fprintf(stderr,"[%d] usage: mpiexec -n 3 %s\n",rank,argv[0]);
     MPI_Abort(MPI_COMM_WORLD,1);
@@ -48,12 +48,12 @@ int main(int argc, char *argv[])
   if (rank == 0) {
     for (i=0; i<cnt; i++) cols[i] = i;
     /* printf("[%d] sending...\n",rank);*/
-    ierr = MPI_Send(cols,cnt,MPI_LONG_LONG_INT,1,0,MPI_COMM_WORLD);
-    ierr = MPI_Send(cols,cnt,MPI_LONG_LONG_INT,2,0,MPI_COMM_WORLD);
+    /* ierr = */ MPI_Send(cols,cnt,MPI_LONG_LONG_INT,1,0,MPI_COMM_WORLD);
+    /* ierr = */ MPI_Send(cols,cnt,MPI_LONG_LONG_INT,2,0,MPI_COMM_WORLD);
   } else {
       /* printf("[%d] receiving...\n",rank); */
     for (i=0; i<cnt; i++) cols[i] = -1;
-    ierr = MPI_Recv(cols,cnt,MPI_LONG_LONG_INT,0,0,MPI_COMM_WORLD,&status);
+    /* ierr = */ MPI_Recv(cols,cnt,MPI_LONG_LONG_INT,0,0,MPI_COMM_WORLD,&status);
     /* ierr = MPI_Get_count(&status,MPI_LONG_LONG_INT,&cnt);
        Get_count still fails because status.count is not 64 bit */
     for (i=0; i<cnt; i++) {
index b45834e..c48d871 100644 (file)
 int main(int argc, char **argv)
 {
     int errs = 0;
-    int found, completed;
     int rank, size;
+#ifdef TEST_MPROBE_ROUTINES
+    int found, completed;
     int sendbuf[8], recvbuf[8];
     int count;
-#ifdef TEST_MPROBE_ROUTINES
     MPI_Message msg;
-#endif
     MPI_Request rreq;
     MPI_Status s1, s2;
+#endif
 
     MPI_Init(&argc, &argv);
 
index 49714c9..e32e5f1 100644 (file)
@@ -15,7 +15,7 @@ static char MTEST_Descrip[] = "Test of various send cancel calls";
 int main( int argc, char *argv[] )
 {
     int errs = 0;
-    int rank, size, source, dest;
+    int rank, size, /* source, */ dest;
     MPI_Comm      comm;
     MPI_Status    status;
     MPI_Request   req;
@@ -33,7 +33,7 @@ int main( int argc, char *argv[] )
     MPI_Comm_rank( comm, &rank );
     MPI_Comm_size( comm, &size );
 
-    source = 0;
+    /* source = 0; */
     dest   = size - 1;
 
     for (cs=0; cs<4; cs++) {
index c78b122..7c8cf65 100644 (file)
@@ -15,7 +15,7 @@ static char MTEST_Descrip[] = "Test of various send cancel calls";
 int main( int argc, char *argv[] )
 {
     int errs = 0;
-    int rank, size, source, dest;
+    int rank, size, /* source, */ dest;
     MPI_Comm      comm;
     MPI_Status    status;
     MPI_Request   req;
@@ -33,7 +33,7 @@ int main( int argc, char *argv[] )
     MPI_Comm_rank( comm, &rank );
     MPI_Comm_size( comm, &size );
 
-    source = 0;
+    /* source = 0; */
     dest   = size - 1;
 
     MTestPrintfMsg( 1, "Starting scancel test\n" );