[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2b4-26-g8833a37

Service Account noreply at mpich.org
Wed Jul 29 19:53:29 CDT 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".

The branch, master has been updated
       via  8833a375f6685898e29ee12be743c6e348d63b15 (commit)
       via  e5f61f172c331346063a21d90c69adfd94032c94 (commit)
       via  b363a94ce709e60e554cdf86f03dc2121712c772 (commit)
       via  3ed5c1a234069cc719e8f54adc06a9d4b7b5a2f1 (commit)
       via  1db4d29375e00590cd41552d88c999b144791a70 (commit)
      from  bc2d5761d6bb2b6e863cf6d3fd292e1db2c95072 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/8833a375f6685898e29ee12be743c6e348d63b15

commit 8833a375f6685898e29ee12be743c6e348d63b15
Author: Min Si <msi at il.is.s.u-tokyo.ac.jp>
Date:   Mon Jul 27 18:32:28 2015 -0500

    Added MTest dataset param for init/check calls in MPI tests.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/test/mpi/coll/bcast.c b/test/mpi/coll/bcast.c
index f465d01..df5f01b 100644
--- a/test/mpi/coll/bcast.c
+++ b/test/mpi/coll/bcast.c
@@ -56,7 +56,7 @@ int main(int argc, char *argv[])
             while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
                 for (root = 0; root < size; root++) {
                     if (rank == root) {
-                        sendtype.InitBuf(&sendtype);
+                        sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
                         err = MPI_Bcast(sendtype.buf, sendtype.count,
                                         sendtype.datatype, root, comm);
                         if (err) {
@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
                         }
                     }
                     else {
-                        recvtype.InitBuf(&recvtype);
+                        recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
                         err = MPI_Bcast(recvtype.buf, recvtype.count,
                                         recvtype.datatype, root, comm);
                         if (err) {
@@ -74,7 +74,7 @@ int main(int argc, char *argv[])
                                     MTestGetIntracommName(), MTestGetDatatypeName(&recvtype));
                             MTestPrintError(err);
                         }
-                        err = MTestCheckRecv(0, &recvtype);
+                        err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
                         if (err) {
                             errs += errs;
                         }
diff --git a/test/mpi/pt2pt/pingping.c b/test/mpi/pt2pt/pingping.c
index d8646f7..39ee9ce 100644
--- a/test/mpi/pt2pt/pingping.c
+++ b/test/mpi/pt2pt/pingping.c
@@ -63,10 +63,10 @@ int main( int argc, char *argv[] )
 				count, MTestGetDatatypeName( &sendtype ), 
 				nbytes*count );
 		/* Make sure that everyone has a recv buffer */
-		recvtype.InitBuf( &recvtype );
+		recvtype.InitBuf( &recvtype, MTEST_DATA_EMPTY );
 
 		if (rank == source) {
-		    sendtype.InitBuf( &sendtype );
+		    sendtype.InitBuf( &sendtype, MTEST_DATA_SET1 );
 		    
 		    for (nmsg=1; nmsg<maxmsg; nmsg++) {
 			err = MPI_Send( sendtype.buf, sendtype.count, 
@@ -91,7 +91,7 @@ int main( int argc, char *argv[] )
 			    }
 			}
 
-			err = MTestCheckRecv( 0, &recvtype );
+			err = MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
 			if (err) {
 			    if (errs < 10) {
 				printf( "Data in target buffer did not match for destination datatype %s and source datatype %s, count = %d, message iteration %d of %d\n", 
@@ -99,7 +99,7 @@ int main( int argc, char *argv[] )
 					MTestGetDatatypeName( &sendtype ),
 					count, nmsg, maxmsg );
 				recvtype.printErrors = 1;
-				(void)MTestCheckRecv( 0, &recvtype );
+				(void)MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
 			    }
 			    errs += err;
 			}
diff --git a/test/mpi/pt2pt/sendrecv1.c b/test/mpi/pt2pt/sendrecv1.c
index 57059eb..7c3cfa2 100644
--- a/test/mpi/pt2pt/sendrecv1.c
+++ b/test/mpi/pt2pt/sendrecv1.c
@@ -42,10 +42,10 @@ int main( int argc, char *argv[] )
 	MTEST_DATATYPE_FOR_EACH_COUNT(count) {
 	    while (MTestGetDatatypes( &sendtype, &recvtype, count )) {
 		/* Make sure that everyone has a recv buffer */
-		recvtype.InitBuf( &recvtype );
+		recvtype.InitBuf( &recvtype, MTEST_DATA_EMPTY );
 
 		if (rank == source) {
-		    sendtype.InitBuf( &sendtype );
+		    sendtype.InitBuf( &sendtype, MTEST_DATA_SET1 );
 		    
 		    err = MPI_Send( sendtype.buf, sendtype.count, 
 				    sendtype.datatype, dest, 0, comm);
@@ -66,7 +66,7 @@ int main( int argc, char *argv[] )
 			}
 		    }
 
-		    err = MTestCheckRecv( 0, &recvtype );
+		    err = MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
 		    if (err) {
 			if (errs < 10) {
 			    printf( "Data in target buffer did not match for destination datatype %s and source datatype %s, count = %d\n", 
@@ -74,7 +74,7 @@ int main( int argc, char *argv[] )
 				    MTestGetDatatypeName( &sendtype ),
 				    count );
 			    recvtype.printErrors = 1;
-			    (void)MTestCheckRecv( 0, &recvtype );
+			    (void)MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
 			}
 			errs += err;
 		    }
diff --git a/test/mpi/pt2pt/sendself.c b/test/mpi/pt2pt/sendself.c
index 6b1e261..0af472c 100644
--- a/test/mpi/pt2pt/sendself.c
+++ b/test/mpi/pt2pt/sendself.c
@@ -34,8 +34,8 @@ int main( int argc, char *argv[] )
     MTEST_DATATYPE_FOR_EACH_COUNT(count) {
 	while (MTestGetDatatypes( &sendtype, &recvtype, count )) {
 	    
-	    sendtype.InitBuf( &sendtype );
-	    recvtype.InitBuf( &recvtype );
+	    sendtype.InitBuf( &sendtype, MTEST_DATA_SET1 );
+	    recvtype.InitBuf( &recvtype, MTEST_DATA_EMPTY );
 	    
 	    err = MPI_Irecv( recvtype.buf, recvtype.count, 
 			    recvtype.datatype, rank, 0, comm, &req );
@@ -55,7 +55,7 @@ int main( int argc, char *argv[] )
 		}
 	    }
 	    err = MPI_Wait( &req, MPI_STATUS_IGNORE );
-	    err = MTestCheckRecv( 0, &recvtype );
+	    err = MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
 	    if (err) {
 		if (errs < 10) {
 		    printf( "Data in target buffer did not match for destination datatype %s and source datatype %s, count = %d\n", 
@@ -63,7 +63,7 @@ int main( int argc, char *argv[] )
 			    MTestGetDatatypeName( &sendtype ),
 			    count );
 		    recvtype.printErrors = 1;
-		    (void)MTestCheckRecv( 0, &recvtype );
+		    (void)MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
 		}
 		errs += err;
 	    }
@@ -86,7 +86,7 @@ int main( int argc, char *argv[] )
 		}
 	    }
 	    err = MPI_Wait( &req, MPI_STATUS_IGNORE );
-	    err = MTestCheckRecv( 0, &recvtype );
+	    err = MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
 	    if (err) {
 		if (errs < 10) {
 		    printf( "Data in target buffer did not match for destination datatype %s and source datatype %s, count = %d\n", 
@@ -94,7 +94,7 @@ int main( int argc, char *argv[] )
 			    MTestGetDatatypeName( &sendtype ),
 			    count );
 		    recvtype.printErrors = 1;
-		    (void)MTestCheckRecv( 0, &recvtype );
+		    (void)MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
 		}
 		errs += err;
 	    }
@@ -117,7 +117,7 @@ int main( int argc, char *argv[] )
 		}
 	    }
 	    err = MPI_Wait( &req, MPI_STATUS_IGNORE );
-	    err = MTestCheckRecv( 0, &recvtype );
+	    err = MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
 	    if (err) {
 		if (errs < 10) {
 		    printf( "Data in target buffer did not match for destination datatype %s and source datatype %s, count = %d\n", 
@@ -125,7 +125,7 @@ int main( int argc, char *argv[] )
 			    MTestGetDatatypeName( &sendtype ),
 			    count );
 		    recvtype.printErrors = 1;
-		    (void)MTestCheckRecv( 0, &recvtype );
+		    (void)MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
 		}
 		errs += err;
 	    }
diff --git a/test/mpi/rma/accfence1.c b/test/mpi/rma/accfence1.c
index 0ede7ab..b53d5a7 100644
--- a/test/mpi/rma/accfence1.c
+++ b/test/mpi/rma/accfence1.c
@@ -39,14 +39,14 @@ int main( int argc, char *argv[] )
 	MTEST_DATATYPE_FOR_EACH_COUNT(count) {
 	    while (MTestGetDatatypes( &sendtype, &recvtype, count )) {
 		/* Make sure that everyone has a recv buffer */
-		recvtype.InitBuf( &recvtype );
+		recvtype.InitBuf( &recvtype, MTEST_DATA_EMPTY );
 
 		MPI_Type_extent( recvtype.datatype, &extent );
 		MPI_Win_create( recvtype.buf, recvtype.count * extent, 
 				(int)extent, MPI_INFO_NULL, comm, &win );
 		MPI_Win_fence( 0, win );
 		if (rank == source) {
-		    sendtype.InitBuf( &sendtype );
+		    sendtype.InitBuf( &sendtype, MTEST_DATA_SET1 );
 
 		    /* To improve reporting of problems about operations, we
 		       change the error handler to errors return */
@@ -81,7 +81,7 @@ int main( int argc, char *argv[] )
 		    MPI_Win_fence( 0, win );
 		    /* This should have the same effect, in terms of
 		       transfering data, as a send/recv pair */
-		    err = MTestCheckRecv( 0, &recvtype );
+		    err = MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
 		    if (err) {
 			errs += err;
 		    }
diff --git a/test/mpi/rma/accpscw1.c b/test/mpi/rma/accpscw1.c
index 893a577..0f7a5fe 100644
--- a/test/mpi/rma/accpscw1.c
+++ b/test/mpi/rma/accpscw1.c
@@ -40,7 +40,7 @@ int main( int argc, char *argv[] )
 	MTEST_DATATYPE_FOR_EACH_COUNT(count) {
 	    while (MTestGetDatatypes( &sendtype, &recvtype, count )) {
 		/* Make sure that everyone has a recv buffer */
-		recvtype.InitBuf( &recvtype );
+		recvtype.InitBuf( &recvtype, MTEST_DATA_EMPTY );
 
 		MPI_Type_extent( recvtype.datatype, &extent );
 		MPI_Win_create( recvtype.buf, recvtype.count * extent, 
@@ -50,7 +50,7 @@ int main( int argc, char *argv[] )
 		    /* To improve reporting of problems about operations, we
 		       change the error handler to errors return */
 		    MPI_Win_set_errhandler( win, MPI_ERRORS_RETURN );
-		    sendtype.InitBuf( &sendtype );
+		    sendtype.InitBuf( &sendtype, MTEST_DATA_SET1 );
 		    
 		    /* Neighbor is dest only */
 		    MPI_Group_incl( wingroup, 1, &dest, &neighbors );
@@ -85,7 +85,7 @@ int main( int argc, char *argv[] )
 		    MPI_Win_wait( win );
 		    /* This should have the same effect, in terms of
 		       transfering data, as a send/recv pair */
-		    err = MTestCheckRecv( 0, &recvtype );
+		    err = MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
 		    if (err) {
 			errs += errs;
 		    }
diff --git a/test/mpi/rma/epochtest.c b/test/mpi/rma/epochtest.c
index 4504454..d9c12d8 100644
--- a/test/mpi/rma/epochtest.c
+++ b/test/mpi/rma/epochtest.c
@@ -66,7 +66,7 @@ int main( int argc, char **argv )
 				MTestGetDatatypeName( &recvtype ) );
 
 		/* Make sure that everyone has a recv buffer */
-		recvtype.InitBuf( &recvtype );
+		recvtype.InitBuf( &recvtype, MTEST_DATA_EMPTY );
 
 		MPI_Type_extent( recvtype.datatype, &extent );
 		MPI_Win_create( recvtype.buf, recvtype.count * extent, 
@@ -82,7 +82,7 @@ int main( int argc, char **argv )
 		if (err) { if (errs++ < MAX_PERR) MTestPrintError(err); }
 		/* Source puts */
 		if (rank == source) {
-		    sendtype.InitBuf( &sendtype );
+		    sendtype.InitBuf( &sendtype, MTEST_DATA_SET1 );
 		    
 		    err = MPI_Put( sendtype.buf, sendtype.count, 
 				   sendtype.datatype, dest, 0, 
@@ -95,12 +95,12 @@ int main( int argc, char **argv )
 		if (err) { if (errs++ < MAX_PERR) MTestPrintError(err); }
 		/* dest checks data, then Dest puts */
 		if (rank == dest) {
-		    err = MTestCheckRecv( 0, &recvtype );
+		    err = MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
 		    if (err) { if (errs++ < MAX_PERR) { 
 			    PrintRecvedError( "fence 2", &sendtype, &recvtype );
 			}
 		    }
-		    sendtype.InitBuf( &sendtype );
+		    sendtype.InitBuf( &sendtype, MTEST_DATA_SET1 );
 		    
 		    err = MPI_Put( sendtype.buf, sendtype.count, 
 				   sendtype.datatype, source, 0, 
@@ -113,12 +113,12 @@ int main( int argc, char **argv )
 		if (err) { if (errs++ < MAX_PERR) MTestPrintError(err); }
 		/* src checks data, then Src and dest puts*/
 		if (rank == source) {
-		    err = MTestCheckRecv( 0, &recvtype );
+		    err = MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
 		    if (err) { if (errs++ < MAX_PERR) { 
 			    PrintRecvedError( "fence 3", &sendtype, &recvtype );
 			}
 		    }
-		    sendtype.InitBuf( &sendtype );
+		    sendtype.InitBuf( &sendtype, MTEST_DATA_SET1 );
 		    
 		    err = MPI_Put( sendtype.buf, sendtype.count, 
 				   sendtype.datatype, dest, 0, 
@@ -126,7 +126,7 @@ int main( int argc, char **argv )
 		    if (err) { if (errs++ < MAX_PERR) MTestPrintError(err); }
 		}
 		if (rank == dest) {
-		    sendtype.InitBuf( &sendtype );
+		    sendtype.InitBuf( &sendtype, MTEST_DATA_SET1 );
 		    
 		    err = MPI_Put( sendtype.buf, sendtype.count, 
 				   sendtype.datatype, source, 0, 
@@ -139,14 +139,14 @@ int main( int argc, char **argv )
 		if (err) { if (errs++ < MAX_PERR) MTestPrintError(err); }
 		/* src and dest checks data */
 		if (rank == source) {
-		    err = MTestCheckRecv( 0, &recvtype );
+		    err = MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
 		    if (err) { if (errs++ < MAX_PERR) { 
 			    PrintRecvedError( "src fence4", &sendtype, &recvtype );
 			}
 		    }
 		}
 		if (rank == dest) {
-		    err = MTestCheckRecv( 0, &recvtype );
+		    err = MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
 		    if (err) { if (errs++ < MAX_PERR) { 
 			    PrintRecvedError( "dest fence4", &sendtype, &recvtype );
 			}
@@ -186,6 +186,6 @@ int PrintRecvedError( const char *msg,
 	    MTestGetDatatypeName( sendtypePtr ) );
     /* Redo the test, with the errors printed */
     recvtypePtr->printErrors = 1;
-    (void)MTestCheckRecv( 0, recvtypePtr );
+    (void)MTestCheckRecv( 0, recvtypePtr, MTEST_DATA_SET1 );
     return 0;
 }
diff --git a/test/mpi/rma/getfence1.c b/test/mpi/rma/getfence1.c
index 80034df..10a3e57 100644
--- a/test/mpi/rma/getfence1.c
+++ b/test/mpi/rma/getfence1.c
@@ -30,8 +30,8 @@ static inline int test(MPI_Comm comm, int rank, int source, int dest,
                     sendtype->count, MTestGetDatatypeName( sendtype ), recvtype->count,
                     MTestGetDatatypeName( recvtype ) );
     /* Make sure that everyone has a recv buffer */
-    recvtype->InitBuf( recvtype );
-    sendtype->InitBuf( sendtype );
+    recvtype->InitBuf( recvtype, MTEST_DATA_EMPTY );
+    sendtype->InitBuf( sendtype, MTEST_DATA_SET1 );
     /* By default, print information about errors */
     recvtype->printErrors = 1;
     sendtype->printErrors = 1;
@@ -69,7 +69,7 @@ static inline int test(MPI_Comm comm, int rank, int source, int dest,
                 MTestPrintError( err );
             }
         }
-        err = MTestCheckRecv( 0, recvtype );
+        err = MTestCheckRecv( 0, recvtype, MTEST_DATA_SET1 );
         if (err) {
             errs += err;
         }
diff --git a/test/mpi/rma/lock_contention_dt.c b/test/mpi/rma/lock_contention_dt.c
index 394f799..97ddb2b 100644
--- a/test/mpi/rma/lock_contention_dt.c
+++ b/test/mpi/rma/lock_contention_dt.c
@@ -36,13 +36,13 @@ int main(int argc, char *argv[])
         MTEST_DATATYPE_FOR_EACH_COUNT(count) {
             while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
                 recvtype.printErrors = 1;
-                recvtype.InitBuf(&recvtype);
+                recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
                 MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
 
                 MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
                                (int) extent, MPI_INFO_NULL, comm, &win);
                 if (rank != target) {
-                    sendtype.InitBuf(&sendtype);
+                    sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
 
                     MPI_Win_lock(MPI_LOCK_EXCLUSIVE, target, 0, win);
                     MPI_Accumulate(sendtype.buf, sendtype.count,
@@ -69,10 +69,10 @@ int main(int argc, char *argv[])
                     int err;
                     MPI_Barrier(comm);
                     MPI_Win_lock(MPI_LOCK_EXCLUSIVE, rank, 0, win);
-                    err = MTestCheckRecv(0, &recvtype);
+                    err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
                     if (err)
                         errs++;
-                    recvtype.InitBuf(&recvtype);
+                    recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
                     MPI_Win_unlock(rank, win);
 
                     /*signal the source that checking and reinitialization is done */
@@ -80,7 +80,7 @@ int main(int argc, char *argv[])
 
                     MPI_Barrier(comm);
                     MPI_Win_lock(MPI_LOCK_EXCLUSIVE, rank, 0, win);
-                    err = MTestCheckRecv(0, &recvtype);
+                    err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
                     if (err)
                         errs++;
                     MPI_Win_unlock(rank, win);
diff --git a/test/mpi/rma/lock_dt.c b/test/mpi/rma/lock_dt.c
index f98d4f4..d3429ec 100644
--- a/test/mpi/rma/lock_dt.c
+++ b/test/mpi/rma/lock_dt.c
@@ -38,13 +38,13 @@ int main(int argc, char *argv[])
             while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
                 recvtype.printErrors = 1;
                 /* Make sure that everyone has a recv buffer */
-                recvtype.InitBuf(&recvtype);
+                recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
                 MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
 
                 MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
                                (int) extent, MPI_INFO_NULL, comm, &win);
                 if (rank == source) {
-                    sendtype.InitBuf(&sendtype);
+                    sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
 
                     MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
                     MPI_Accumulate(sendtype.buf, sendtype.count,
@@ -71,10 +71,10 @@ int main(int argc, char *argv[])
                     int err;
                     MPI_Barrier(comm);
                     MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
-                    err = MTestCheckRecv(0, &recvtype);
+                    err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
                     if (err)
                         errs++;
-                    recvtype.InitBuf(&recvtype);
+                    recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
                     MPI_Win_unlock(dest, win);
 
                     /*signal the source that checking and reinitialization is done */
@@ -82,7 +82,7 @@ int main(int argc, char *argv[])
 
                     MPI_Barrier(comm);
                     MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
-                    err = MTestCheckRecv(0, &recvtype);
+                    err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
                     if (err)
                         errs++;
                     MPI_Win_unlock(dest, win);
diff --git a/test/mpi/rma/lock_dt_flush.c b/test/mpi/rma/lock_dt_flush.c
index 336da04..4f61232 100644
--- a/test/mpi/rma/lock_dt_flush.c
+++ b/test/mpi/rma/lock_dt_flush.c
@@ -37,13 +37,13 @@ int main(int argc, char *argv[])
         MTEST_DATATYPE_FOR_EACH_COUNT(count) {
             while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
                 recvtype.printErrors = 1;
-                recvtype.InitBuf(&recvtype);
+                recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
                 MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
 
                 MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
                                (int) extent, MPI_INFO_NULL, comm, &win);
                 if (rank == source) {
-                    sendtype.InitBuf(&sendtype);
+                    sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
 
                     MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
                     MPI_Accumulate(sendtype.buf, sendtype.count,
@@ -78,10 +78,10 @@ int main(int argc, char *argv[])
 
                     MPI_Barrier(comm);
                     MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
-                    err = MTestCheckRecv(0, &recvtype);
+                    err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
                     if (err)
                         errs++;
-                    recvtype.InitBuf(&recvtype);
+                    recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
                     MPI_Barrier(comm);
                     MPI_Win_unlock(dest, win);
 
@@ -90,7 +90,7 @@ int main(int argc, char *argv[])
 
                     MPI_Barrier(comm);
                     MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
-                    err = MTestCheckRecv(0, &recvtype);
+                    err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
                     if (err)
                         errs++;
                     MPI_Barrier(comm);
diff --git a/test/mpi/rma/lock_dt_flushlocal.c b/test/mpi/rma/lock_dt_flushlocal.c
index fe6db8a..f76bdfc 100644
--- a/test/mpi/rma/lock_dt_flushlocal.c
+++ b/test/mpi/rma/lock_dt_flushlocal.c
@@ -39,7 +39,7 @@ int main(int argc, char *argv[])
         MTEST_DATATYPE_FOR_EACH_COUNT(count) {
             while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
                 recvtype.printErrors = 1;
-                recvtype.InitBuf(&recvtype);
+                recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
                 MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
 
                 MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
@@ -47,7 +47,7 @@ int main(int argc, char *argv[])
                 if (rank == source) {
                     MPI_Aint slb, sextent;
                     MPI_Type_get_extent(sendtype.datatype, &slb, &sextent);
-                    sendtype.InitBuf(&sendtype);
+                    sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
 
                     MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
                     MPI_Accumulate(sendtype.buf, sendtype.count,
@@ -59,7 +59,7 @@ int main(int argc, char *argv[])
                     MPI_Win_unlock(dest, win);
                     MPI_Barrier(comm);
 
-                    sendtype.InitBuf(&sendtype);
+                    sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
                     char *resbuf = (char *) calloc(lb + extent * recvtype.count, sizeof(char));
 
                     /*wait for the destination to finish checking and reinitializing the buffer */
@@ -81,10 +81,10 @@ int main(int argc, char *argv[])
 
                     MPI_Barrier(comm);
                     MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
-                    err = MTestCheckRecv(0, &recvtype);
+                    err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
                     if (err)
                         errs++;
-                    recvtype.InitBuf(&recvtype);
+                    recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
                     MPI_Win_unlock(dest, win);
 
                     /*signal the source that checking and reinitialization is done */
@@ -92,7 +92,7 @@ int main(int argc, char *argv[])
 
                     MPI_Barrier(comm);
                     MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
-                    err = MTestCheckRecv(0, &recvtype);
+                    err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
                     if (err)
                         errs++;
                     MPI_Win_unlock(dest, win);
diff --git a/test/mpi/rma/lockall_dt.c b/test/mpi/rma/lockall_dt.c
index bdb7e97..542b4ac 100644
--- a/test/mpi/rma/lockall_dt.c
+++ b/test/mpi/rma/lockall_dt.c
@@ -36,14 +36,14 @@ int main(int argc, char *argv[])
         MTEST_DATATYPE_FOR_EACH_COUNT(count) {
             while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
                 recvtype.printErrors = 1;
-                recvtype.InitBuf(&recvtype);
+                recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
                 MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
 
                 MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
                                (int) extent, MPI_INFO_NULL, comm, &win);
                 if (rank == source) {
                     int dest;
-                    sendtype.InitBuf(&sendtype);
+                    sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
 
                     MPI_Win_lock_all(0, win);
                     for (dest = 0; dest < size; dest++)
@@ -77,10 +77,10 @@ int main(int argc, char *argv[])
                     int err;
                     MPI_Barrier(comm);
                     MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
-                    err = MTestCheckRecv(0, &recvtype);
+                    err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
                     if (err)
                         errs++;
-                    recvtype.InitBuf(&recvtype);
+                    recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
                     MPI_Win_unlock(rank, win);
 
                     /*signal the source that checking and reinitialization is done */
@@ -88,7 +88,7 @@ int main(int argc, char *argv[])
 
                     MPI_Barrier(comm);
                     MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
-                    err = MTestCheckRecv(0, &recvtype);
+                    err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
                     if (err)
                         errs++;
                     MPI_Win_unlock(rank, win);
diff --git a/test/mpi/rma/lockall_dt_flush.c b/test/mpi/rma/lockall_dt_flush.c
index f6ddde3..e57dc40 100644
--- a/test/mpi/rma/lockall_dt_flush.c
+++ b/test/mpi/rma/lockall_dt_flush.c
@@ -36,14 +36,14 @@ int main(int argc, char *argv[])
         MTEST_DATATYPE_FOR_EACH_COUNT(count) {
             while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
                 recvtype.printErrors = 1;
-                recvtype.InitBuf(&recvtype);
+                recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
                 MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
 
                 MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
                                (int) extent, MPI_INFO_NULL, comm, &win);
                 if (rank == source) {
                     int dest;
-                    sendtype.InitBuf(&sendtype);
+                    sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
 
                     MPI_Win_lock_all(0, win);
 
@@ -85,10 +85,10 @@ int main(int argc, char *argv[])
                     int err;
                     MPI_Barrier(comm);
                     MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
-                    err = MTestCheckRecv(0, &recvtype);
+                    err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
                     if (err)
                         errs++;
-                    recvtype.InitBuf(&recvtype);
+                    recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
                     MPI_Barrier(comm);
                     MPI_Win_unlock(rank, win);
 
@@ -97,7 +97,7 @@ int main(int argc, char *argv[])
 
                     MPI_Barrier(comm);
                     MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
-                    err = MTestCheckRecv(0, &recvtype);
+                    err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
                     if (err)
                         errs++;
                     MPI_Barrier(comm);
diff --git a/test/mpi/rma/lockall_dt_flushall.c b/test/mpi/rma/lockall_dt_flushall.c
index 9fdf416..08b84a1 100644
--- a/test/mpi/rma/lockall_dt_flushall.c
+++ b/test/mpi/rma/lockall_dt_flushall.c
@@ -36,14 +36,14 @@ int main(int argc, char *argv[])
         MTEST_DATATYPE_FOR_EACH_COUNT(count) {
             while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
                 recvtype.printErrors = 1;
-                recvtype.InitBuf(&recvtype);
+                recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
                 MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
 
                 MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
                                (int) extent, MPI_INFO_NULL, comm, &win);
                 if (rank == source) {
                     int dest;
-                    sendtype.InitBuf(&sendtype);
+                    sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
 
                     MPI_Win_lock_all(0, win);
                     for (dest = 0; dest < size; dest++)
@@ -86,10 +86,10 @@ int main(int argc, char *argv[])
                     int err;
                     MPI_Barrier(comm);
                     MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
-                    err = MTestCheckRecv(0, &recvtype);
+                    err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
                     if (err)
                         errs++;
-                    recvtype.InitBuf(&recvtype);
+                    recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
                     MPI_Barrier(comm);
                     MPI_Win_unlock(rank, win);
 
@@ -98,7 +98,7 @@ int main(int argc, char *argv[])
 
                     MPI_Barrier(comm);
                     MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
-                    err = MTestCheckRecv(0, &recvtype);
+                    err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
                     if (err)
                         errs++;
                     MPI_Barrier(comm);
diff --git a/test/mpi/rma/lockall_dt_flushlocal.c b/test/mpi/rma/lockall_dt_flushlocal.c
index a3726b6..d40e6bc 100644
--- a/test/mpi/rma/lockall_dt_flushlocal.c
+++ b/test/mpi/rma/lockall_dt_flushlocal.c
@@ -37,7 +37,7 @@ int main(int argc, char *argv[])
         MTEST_DATATYPE_FOR_EACH_COUNT(count) {
             while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
                 recvtype.printErrors = 1;
-                recvtype.InitBuf(&recvtype);
+                recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
                 MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
 
                 MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
@@ -46,7 +46,7 @@ int main(int argc, char *argv[])
                     int dest;
                     MPI_Aint slb, sextent;
                     MPI_Type_get_extent(sendtype.datatype, &slb, &sextent);
-                    sendtype.InitBuf(&sendtype);
+                    sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
 
                     MPI_Win_lock_all(0, win);
 
@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
                     MPI_Win_unlock_all(win);
                     MPI_Barrier(comm);
 
-                    sendtype.InitBuf(&sendtype);
+                    sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
                     char *resbuf = (char *) calloc(lb + extent * recvtype.count, sizeof(char));
 
                     /*wait for the destinations to finish checking and reinitializing the buffers */
@@ -87,10 +87,10 @@ int main(int argc, char *argv[])
                     int err;
                     MPI_Barrier(comm);
                     MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
-                    err = MTestCheckRecv(0, &recvtype);
+                    err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
                     if (err)
                         errs++;
-                    recvtype.InitBuf(&recvtype);
+                    recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
                     MPI_Win_unlock(rank, win);
 
                     /*signal the source that checking and reinitialization is done */
@@ -98,7 +98,7 @@ int main(int argc, char *argv[])
 
                     MPI_Barrier(comm);
                     MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
-                    err = MTestCheckRecv(0, &recvtype);
+                    err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
                     if (err)
                         errs++;
                     MPI_Win_unlock(rank, win);
diff --git a/test/mpi/rma/lockall_dt_flushlocalall.c b/test/mpi/rma/lockall_dt_flushlocalall.c
index 9d662fa..acd4853 100644
--- a/test/mpi/rma/lockall_dt_flushlocalall.c
+++ b/test/mpi/rma/lockall_dt_flushlocalall.c
@@ -37,7 +37,7 @@ int main(int argc, char *argv[])
         MTEST_DATATYPE_FOR_EACH_COUNT(count) {
             while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
                 recvtype.printErrors = 1;
-                recvtype.InitBuf(&recvtype);
+                recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
                 MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
 
                 MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
@@ -46,7 +46,7 @@ int main(int argc, char *argv[])
                     int dest;
                     MPI_Aint slb, sextent;
                     MPI_Type_get_extent(sendtype.datatype, &slb, &sextent);
-                    sendtype.InitBuf(&sendtype);
+                    sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
 
                     MPI_Win_lock_all(0, win);
                     for (dest = 0; dest < size; dest++)
@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
                     MPI_Win_unlock_all(win);
                     MPI_Barrier(comm);
 
-                    sendtype.InitBuf(&sendtype);
+                    sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
                     char *resbuf = (char *) calloc(lb + extent * recvtype.count, sizeof(char));
 
                     /*wait for the destination to finish checking and reinitializing the buffer */
@@ -88,10 +88,10 @@ int main(int argc, char *argv[])
                     int err;
                     MPI_Barrier(comm);
                     MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
-                    err = MTestCheckRecv(0, &recvtype);
+                    err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
                     if (err)
                         errs++;
-                    recvtype.InitBuf(&recvtype);
+                    recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
                     MPI_Win_unlock(rank, win);
 
                     /*signal the source that checking and reinitialization is done */
@@ -99,7 +99,7 @@ int main(int argc, char *argv[])
 
                     MPI_Barrier(comm);
                     MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
-                    err = MTestCheckRecv(0, &recvtype);
+                    err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
                     if (err)
                         errs++;
                     MPI_Win_unlock(rank, win);
diff --git a/test/mpi/rma/putfence1.c b/test/mpi/rma/putfence1.c
index de13720..b79a10a 100644
--- a/test/mpi/rma/putfence1.c
+++ b/test/mpi/rma/putfence1.c
@@ -30,7 +30,7 @@ static inline int test(MPI_Comm comm, int rank, int source, int dest,
                     MTestGetDatatypeName( recvtype ) );
 
     /* Make sure that everyone has a recv buffer */
-    recvtype->InitBuf( recvtype );
+    recvtype->InitBuf( recvtype, MTEST_DATA_EMPTY );
     MPI_Type_extent( recvtype->datatype, &extent );
     MPI_Win_create( recvtype->buf, recvtype->count * extent,
                     extent, MPI_INFO_NULL, comm, &win );
@@ -40,7 +40,7 @@ static inline int test(MPI_Comm comm, int rank, int source, int dest,
            change the error handler to errors return */
         MPI_Win_set_errhandler( win, MPI_ERRORS_RETURN );
 
-        sendtype->InitBuf( sendtype );
+        sendtype->InitBuf( sendtype, MTEST_DATA_SET1 );
 
         err = MPI_Put( sendtype->buf, sendtype->count,
                        sendtype->datatype, dest, 0,
@@ -63,7 +63,7 @@ static inline int test(MPI_Comm comm, int rank, int source, int dest,
         MPI_Win_fence( 0, win );
         /* This should have the same effect, in terms of
            transfering data, as a send/recv pair */
-        err = MTestCheckRecv( 0, recvtype );
+        err = MTestCheckRecv( 0, recvtype, MTEST_DATA_SET1 );
         if (err) {
             if (errs < 10) {
                 printf( "Data in target buffer did not match for destination datatype %s (put with source datatype %s)\n",
@@ -71,7 +71,7 @@ static inline int test(MPI_Comm comm, int rank, int source, int dest,
                         MTestGetDatatypeName( sendtype ) );
                 /* Redo the test, with the errors printed */
                 recvtype->printErrors = 1;
-                (void)MTestCheckRecv( 0, recvtype );
+                (void)MTestCheckRecv( 0, recvtype, MTEST_DATA_SET1 );
             }
             errs += err;
         }
diff --git a/test/mpi/rma/putpscw1.c b/test/mpi/rma/putpscw1.c
index fb05df5..d8cc9ef 100644
--- a/test/mpi/rma/putpscw1.c
+++ b/test/mpi/rma/putpscw1.c
@@ -40,7 +40,7 @@ int main( int argc, char *argv[] )
 	MTEST_DATATYPE_FOR_EACH_COUNT(count) {
 	    while (MTestGetDatatypes( &sendtype, &recvtype, count )) {
 		/* Make sure that everyone has a recv buffer */
-		recvtype.InitBuf( &recvtype );
+		recvtype.InitBuf( &recvtype, MTEST_DATA_EMPTY );
 
 		MPI_Type_extent( recvtype.datatype, &extent );
 		MPI_Win_create( recvtype.buf, recvtype.count * extent, 
@@ -50,7 +50,7 @@ int main( int argc, char *argv[] )
 		    /* To improve reporting of problems about operations, we
 		       change the error handler to errors return */
 		    MPI_Win_set_errhandler( win, MPI_ERRORS_RETURN );
-		    sendtype.InitBuf( &sendtype );
+		    sendtype.InitBuf( &sendtype, MTEST_DATA_SET1 );
 		    
 		    /* Neighbor is dest only */
 		    MPI_Group_incl( wingroup, 1, &dest, &neighbors );
@@ -84,7 +84,7 @@ int main( int argc, char *argv[] )
 		    MPI_Win_wait( win );
 		    /* This should have the same effect, in terms of
 		       transfering data, as a send/recv pair */
-		    err = MTestCheckRecv( 0, &recvtype );
+		    err = MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
 		    if (err) {
 			errs += errs;
 		    }
diff --git a/test/mpi/template.c b/test/mpi/template.c
index 801fc5e..a498f10 100644
--- a/test/mpi/template.c
+++ b/test/mpi/template.c
@@ -41,7 +41,7 @@ int main( int argc, char *argv[] )
 	MTEST_DATATYPE_FOR_EACH_COUNT(count) {
 	    while (MTestGetDatatypes( &sendtype, &recvtype, count )) {
 		if (rank == source) {
-		    sendtype.InitBuf( &sendtype );
+		    sendtype.InitBuf( &sendtype, MTEST_DATA_SET1 );
 		    
 		    err = MPI_Send( sendtype.buf, sendtype.count, 
 				    sendtype.datatype, dest, 0, comm );
@@ -52,7 +52,7 @@ int main( int argc, char *argv[] )
 		    MTestFreeDatatype( &sendtype );
 		}
 		else if (rank == dest) {
-		    recvtype.InitBuf( &recvtype );
+		    recvtype.InitBuf( &recvtype, MTEST_DATA_EMPTY );
 		    err = MPI_Recv( recvtype.buf, recvtype.count, 
 				    recvtype.datatype, source, 0, comm, &status );
 		    if (err) {
@@ -62,7 +62,7 @@ int main( int argc, char *argv[] )
 				 MTestGetDatatypeName( &recvtype ) );
 			MTestPrintError( err );
 		    }
-		    err = MTestCheckRecv( &status, &recvtype );
+		    err = MTestCheckRecv( &status, &recvtype, MTEST_DATA_SET1 );
 		    if (err) {
 			errs += errs;
 		    }

http://git.mpich.org/mpich.git/commitdiff/e5f61f172c331346063a21d90c69adfd94032c94

commit e5f61f172c331346063a21d90c69adfd94032c94
Author: Min Si <msi at il.is.s.u-tokyo.ac.jp>
Date:   Mon Jul 27 23:31:49 2015 -0500

    Added declaration for MTest basic datatype initialization.
    
    This function allows a specified test to initialize test cases only for
    basic datatypes. It overwrites the global environment variable
    MPITEST_DATATYPE_TEST_LEVEL.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/test/mpi/include/mpitest.h b/test/mpi/include/mpitest.h
index 0be5f6c..1cbeb42 100644
--- a/test/mpi/include/mpitest.h
+++ b/test/mpi/include/mpitest.h
@@ -80,6 +80,10 @@ void MTestInitFullDatatypes(void);
  * It generate tests for all basic datatypes, vector and indexed. */
 void MTestInitMinDatatypes(void);
 
+/* Setup the basic version of datatype tests.
+ * It generate tests for all basic datatypes. */
+void MTestInitBasicDatatypes(void);
+
 int MTestCheckRecv( MPI_Status *, MTestDatatype *, MTestDataset );
 int MTestGetDatatypes( MTestDatatype *, MTestDatatype *, MPI_Aint );
 void MTestResetDatatypes( void );

http://git.mpich.org/mpich.git/commitdiff/b363a94ce709e60e554cdf86f03dc2121712c772

commit b363a94ce709e60e554cdf86f03dc2121712c772
Author: Min Si <msi at il.is.s.u-tokyo.ac.jp>
Date:   Mon Jul 27 23:48:30 2015 -0500

    Support multiple dataset in MTest datatype routine.
    
    Some tests require different sets of data to initialize the datatype
    buffer, but not only send buffer with data and empty receive buffer.
    For example, in get_acc tests, the window buffer (recvbuf) needs
    another set of data to check the correctness of result buffer.
    
    In this patch, we add MTestDataset parameter(empty|set1|set2) into
    init/check function calls, thus test program can initialize/check the
    buffers using different sets of data.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/test/mpi/include/mpitest.h b/test/mpi/include/mpitest.h
index 1440f4e..0be5f6c 100644
--- a/test/mpi/include/mpitest.h
+++ b/test/mpi/include/mpitest.h
@@ -27,6 +27,12 @@ int MTestReturnValue( int );
 void MTestSleep( int );
 void MTestGetDbgInfo(int *dbgflag, int *verbose);
 
+typedef enum _MTestDataset{
+    MTEST_DATA_EMPTY,
+    MTEST_DATA_SET1,
+    MTEST_DATA_SET2
+} MTestDataset;
+
 /*
  * This structure contains the information used to test datatypes
  * buf is set to null when an MTestDatatype is created; the
@@ -54,9 +60,9 @@ typedef struct _MTestDatatype {
     /* used in subarray */
     int arr_sizes[2], arr_subsizes[2], arr_starts[2], order;
 
-    void *(*InitBuf)( struct _MTestDatatype * );
+    void *(*InitBuf)( struct _MTestDatatype *, MTestDataset );
     void *(*FreeBuf)( struct _MTestDatatype * );
-    int   (*CheckBuf)( struct _MTestDatatype * );
+    int   (*CheckBuf)( struct _MTestDatatype *, MTestDataset );
     int   (*Dup)( struct _MTestDatatype, struct _MTestDatatype * );
 } MTestDatatype;
 
@@ -74,7 +80,7 @@ void MTestInitFullDatatypes(void);
  * It generate tests for all basic datatypes, vector and indexed. */
 void MTestInitMinDatatypes(void);
 
-int MTestCheckRecv( MPI_Status *, MTestDatatype * );
+int MTestCheckRecv( MPI_Status *, MTestDatatype *, MTestDataset );
 int MTestGetDatatypes( MTestDatatype *, MTestDatatype *, MPI_Aint );
 void MTestResetDatatypes( void );
 void MTestFreeDatatype( MTestDatatype * );
diff --git a/test/mpi/util/mtest_datatype.c b/test/mpi/util/mtest_datatype.c
index 6624b19..3877347 100644
--- a/test/mpi/util/mtest_datatype.c
+++ b/test/mpi/util/mtest_datatype.c
@@ -30,7 +30,69 @@
 
 
 /* ------------------------------------------------------------------------ */
-/* General datatype routines                        */
+/* Internal functions                                                       */
+/* ------------------------------------------------------------------------ */
+
+/**
+ * Decode a datatype object, return its extent, total space, and total size.
+ */
+static inline void datatype_decode(MTestDatatype * mtype, MPI_Aint * extent,
+                                   MPI_Aint * totspace, MPI_Aint * totsize)
+{
+    int dt_size;
+    MPI_Aint lb;
+    int merr = 0;
+
+    merr = MPI_Type_get_extent(mtype->datatype, &lb, extent);
+    if (merr)
+        MTestPrintError(merr);
+
+    merr = MPI_Type_size(mtype->datatype, &dt_size);
+    if (merr)
+        MTestPrintError(merr);
+
+    (*totspace) = lb + mtype->count * (*extent);
+    (*totsize) = mtype->count * dt_size;
+}
+
+/**
+ * Initialize parameters to generate a dataset.
+ *
+ * It returns data generating parameters to the upper function to generate value
+ * for each element. The current version generates an arithmetic sequence with
+ * following two parameters, this might be changed in future.
+ * - init_term, the value of the first element.
+ * - common_diff, the multiply for the next element.
+ *
+ * Note that we generate totally different sequence for each dataset, thus the
+ * test can specify different datasets for multiple buffers, and check the
+ * correctness of every byte in the receiving buffer. For example, in get_acc
+ * test, the origin buffer, result buffer, and window buffer can have different
+ * value, thus both result buffer and window buffer can be checked in single
+ * execution.
+ */
+static void init_dataset_params(MTestDataset dataset, MPI_Aint set_size,
+                                MPI_Aint * init_term, MPI_Aint * common_diff)
+{
+    switch (dataset) {
+    case MTEST_DATA_SET1:
+        (*init_term) = 0;
+        (*common_diff) = 1;
+        break;
+    case MTEST_DATA_SET2:
+        (*init_term) = set_size;
+        (*common_diff) = 1;
+        break;
+    case MTEST_DATA_EMPTY:
+    default:
+        (*init_term) = 0;
+        (*common_diff) = 0;
+        break;
+    }
+}
+
+/* ------------------------------------------------------------------------ */
+/* General datatype routines                                                */
 /* ------------------------------------------------------------------------ */
 
 static void *MTestTypeFree(MTestDatatype * mtype)
@@ -145,22 +207,22 @@ static int MTestTypeDup(MTestDatatype old_mtype, MTestDatatype * new_mtype)
 /*
  * Initialize buffer of basic datatype
  */
-static void *MTestTypeContigInit(MTestDatatype * mtype)
+static void *MTestTypeContigInit(MTestDatatype * mtype, MTestDataset dataset)
 {
-    MPI_Aint extent = 0, lb = 0, size;
-    int merr;
+    MPI_Aint totspace = 0, extent = 0;
+    MPI_Aint init_term = 0, common_diff = 0, data = 0, totsize = 0;
 
     if (mtype->count > 0) {
         unsigned char *p;
-        MPI_Aint i, totsize;
-        merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
-        if (merr)
-            MTestPrintError(merr);
+        MPI_Aint i;
 
-        size = extent + lb;
-        totsize = size * mtype->count;
+        /* Get datatype information and dataset */
+        datatype_decode(mtype, &extent, &totspace, &totsize);
+        init_dataset_params(dataset, totsize, &init_term, &common_diff);
+
+        /* Allocate buffer */
         if (!mtype->buf) {
-            mtype->buf = (void *) malloc(totsize);
+            mtype->buf = (void *) malloc(totspace);
         }
         p = (unsigned char *) (mtype->buf);
         if (!p) {
@@ -168,8 +230,11 @@ static void *MTestTypeContigInit(MTestDatatype * mtype)
             sprintf(errmsg, "Out of memory in %s", __FUNCTION__);
             MTestError(errmsg);
         }
-        for (i = 0; i < totsize; i++) {
-            p[i] = (unsigned char) (0xff ^ (i & 0xff));
+
+        /* Now, set value into actual elements. */
+        data = init_term;
+        for (i = 0; i < totspace; i++) {
+            p[i] = (unsigned char) (0xff ^ ((data++ * common_diff) & 0xff));
         }
     }
     else {
@@ -184,23 +249,24 @@ static void *MTestTypeContigInit(MTestDatatype * mtype)
 /*
  * Check value of received basic datatype buffer.
  */
-static int MTestTypeContigCheckbuf(MTestDatatype * mtype)
+static int MTestTypeContigCheckbuf(MTestDatatype * mtype, MTestDataset dataset)
 {
     unsigned char *p;
     unsigned char expected;
-    int err = 0, merr;
-    MPI_Aint i, totsize, size, extent = 0, lb = 0;
+    int err = 0;
+    MPI_Aint i, totspace = 0, extent = 0;
+    MPI_Aint init_term = 0, common_diff = 0, data = 0, totsize = 0;
 
     p = (unsigned char *) mtype->buf;
     if (p) {
-        merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
-        if (merr)
-            MTestPrintError(merr);
-
-        size = lb + extent;
-        totsize = size * mtype->count;
-        for (i = 0; i < totsize; i++) {
-            expected = (unsigned char) (0xff ^ (i & 0xff));
+        /* Get datatype information and dataset */
+        datatype_decode(mtype, &extent, &totspace, &totsize);
+        init_dataset_params(dataset, totsize, &init_term, &common_diff);
+
+        data = init_term;
+        for (i = 0; i < totspace; i++) {
+            expected = (unsigned char) (0xff ^ ((data++ * common_diff) & 0xff));
+
             if (p[i] != expected) {
                 err++;
                 if (mtype->printErrors && err < 10) {
@@ -221,24 +287,23 @@ static int MTestTypeContigCheckbuf(MTestDatatype * mtype)
 /*
  * Initialize buffer of vector datatype
  */
-static void *MTestTypeVectorInit(MTestDatatype * mtype)
+static void *MTestTypeVectorInit(MTestDatatype * mtype, MTestDataset dataset)
 {
-    MPI_Aint extent = 0, lb = 0, size, totsize, dt_offset, byte_offset;
-    int merr;
+    MPI_Aint totspace = 0, extent = 0, dt_offset, byte_offset;
+    MPI_Aint init_term = 0, common_diff = 0, data = 0, totsize = 0;
 
     if (mtype->count > 0) {
         unsigned char *p;
         MPI_Aint k, j;
-        int i, nc;
+        int i;
 
-        merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
-        if (merr)
-            MTestPrintError(merr);
+        /* Get datatype information and dataset */
+        datatype_decode(mtype, &extent, &totspace, &totsize);
+        init_dataset_params(dataset, totsize, &init_term, &common_diff);
 
-        size = extent + lb;
-        totsize = mtype->count * size;
+        /* Allocate buffer */
         if (!mtype->buf) {
-            mtype->buf = (void *) malloc(totsize);
+            mtype->buf = (void *) malloc(totspace);
         }
         p = (unsigned char *) (mtype->buf);
         if (!p) {
@@ -248,12 +313,16 @@ static void *MTestTypeVectorInit(MTestDatatype * mtype)
         }
 
         /* First, set to -1 */
-        for (k = 0; k < totsize; k++)
+        for (k = 0; k < totspace; k++)
             p[k] = 0xff;
 
-        /* Now, set the actual elements to the successive values.
+        /* For empty initialization, it is done. */
+        if (dataset == MTEST_DATA_EMPTY)
+            return mtype->buf;
+
+        /* Now, set value into actual elements.
          * We require that the base type is a contiguous type */
-        nc = 0;
+        data = init_term;
         dt_offset = 0;
         /* For each datatype */
         for (k = 0; k < mtype->count; k++) {
@@ -262,11 +331,10 @@ static void *MTestTypeVectorInit(MTestDatatype * mtype)
                 byte_offset = dt_offset + i * mtype->stride;
                 /* For each byte */
                 for (j = 0; j < mtype->blksize; j++) {
-                    p[byte_offset + j] = (unsigned char) (0xff ^ (nc & 0xff));
-                    nc++;
+                    p[byte_offset + j] = (unsigned char) (0xff ^ ((data++ * common_diff) & 0xff));
                 }
             }
-            dt_offset += size;
+            dt_offset += extent;
         }
     }
     else {
@@ -278,24 +346,24 @@ static void *MTestTypeVectorInit(MTestDatatype * mtype)
 /*
  * Check value of received vector datatype buffer
  */
-static int MTestTypeVectorCheckbuf(MTestDatatype * mtype)
+static int MTestTypeVectorCheckbuf(MTestDatatype * mtype, MTestDataset dataset)
 {
     unsigned char *p;
     unsigned char expected;
-    int i, err = 0, merr;
-    MPI_Aint size = 0, byte_offset, dt_offset, extent, lb;
+    int i, err = 0;
+    MPI_Aint totspace = 0, extent = 0, byte_offset, dt_offset;
+    MPI_Aint init_term = 0, common_diff = 0, data = 0, totsize = 0;
 
     p = (unsigned char *) mtype->buf;
     if (p) {
         MPI_Aint k, j;
-        int nc;
-        merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
-        if (merr)
-            MTestPrintError(merr);
 
-        size = extent + lb;
-        nc = 0;
+        /* Get datatype information and dataset */
+        datatype_decode(mtype, &extent, &totspace, &totsize);
+        init_dataset_params(dataset, totsize, &init_term, &common_diff);
+
         dt_offset = 0;
+        data = init_term;
         /* For each datatype */
         for (k = 0; k < mtype->count; k++) {
             /* For each block */
@@ -303,19 +371,18 @@ static int MTestTypeVectorCheckbuf(MTestDatatype * mtype)
                 byte_offset = dt_offset + i * mtype->stride;
                 /* For each byte */
                 for (j = 0; j < mtype->blksize; j++) {
-                    expected = (unsigned char) (0xff ^ (nc & 0xff));
+                    expected = (unsigned char) (0xff ^ ((data++ * common_diff) & 0xff));
                     if (p[byte_offset + j] != expected) {
                         err++;
                         if (mtype->printErrors && err < 10) {
-                            printf("Data expected = %x but got p[%d,%d] = %x\n", expected, i, j,
+                            printf("Data expected = %x but got p[%d,%ld] = %x\n", expected, i, j,
                                    p[byte_offset + j]);
                             fflush(stdout);
                         }
                     }
-                    nc++;
                 }
             }
-            dt_offset += size;
+            dt_offset += extent;
         }
     }
     return err;
@@ -329,26 +396,23 @@ static int MTestTypeVectorCheckbuf(MTestDatatype * mtype)
 /*
  * Initialize buffer of indexed datatype
  */
-static void *MTestTypeIndexedInit(MTestDatatype * mtype)
+static void *MTestTypeIndexedInit(MTestDatatype * mtype, MTestDataset dataset)
 {
-    MPI_Aint extent = 0, lb = 0, size, totsize, dt_offset, offset;
-    int merr;
+    MPI_Aint totspace = 0, extent = 0, dt_offset, offset;
+    MPI_Aint init_term = 0, common_diff = 0, data = 0, totsize = 0;
 
     if (mtype->count > 0) {
         unsigned char *p;
         MPI_Aint k, b;
-        int i, j, nc;
-
-        /* Allocate buffer */
-        merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
-        if (merr)
-            MTestPrintError(merr);
+        int i, j;
 
-        size = extent + lb;
-        totsize = size * mtype->count;
+        /* Get datatype information and dataset */
+        datatype_decode(mtype, &extent, &totspace, &totsize);
+        init_dataset_params(dataset, totsize, &init_term, &common_diff);
 
+        /* Allocate buffer */
         if (!mtype->buf) {
-            mtype->buf = (void *) malloc(totsize);
+            mtype->buf = (void *) malloc(totspace);
         }
         p = (unsigned char *) (mtype->buf);
         if (!p) {
@@ -358,12 +422,16 @@ static void *MTestTypeIndexedInit(MTestDatatype * mtype)
         }
 
         /* First, set to -1 */
-        for (k = 0; k < totsize; k++)
+        for (k = 0; k < totspace; k++)
             p[k] = 0xff;
 
-        /* Now, set the actual elements to the successive values.
+        /* For empty initialization, it is done. */
+        if (dataset == MTEST_DATA_EMPTY)
+            return mtype->buf;
+
+        /* Now, set value into actual elements.
          * We require that the base type is a contiguous type */
-        nc = 0;
+        data = init_term;
         dt_offset = 0;
         /* For each datatype */
         for (k = 0; k < mtype->count; k++) {
@@ -375,11 +443,11 @@ static void *MTestTypeIndexedInit(MTestDatatype * mtype)
                         + j * mtype->basesize;
                     /* For each byte in the element */
                     for (b = 0; b < mtype->basesize; b++) {
-                        p[offset + b] = (unsigned char) (0xff ^ (nc++ & 0xff));
+                        p[offset + b] = (unsigned char) (0xff ^ ((data++ * common_diff) & 0xff));
                     }
                 }
             }
-            dt_offset += size;
+            dt_offset += extent;
         }
     }
     else {
@@ -395,24 +463,25 @@ static void *MTestTypeIndexedInit(MTestDatatype * mtype)
 /*
  * Check value of received indexed datatype buffer
  */
-static int MTestTypeIndexedCheckbuf(MTestDatatype * mtype)
+static int MTestTypeIndexedCheckbuf(MTestDatatype * mtype, MTestDataset dataset)
 {
     unsigned char *p;
     unsigned char expected;
-    int err = 0, merr;
-    MPI_Aint size = 0, offset, dt_offset, extent = 0, lb = 0;
+    int err = 0;
+    MPI_Aint totspace = 0, extent = 0, offset, dt_offset;
+    MPI_Aint init_term = 0, common_diff = 0, data = 0, totsize = 0;
 
     p = (unsigned char *) mtype->buf;
     if (p) {
         MPI_Aint k, b;
-        int i, j, nc;
-        merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
-        if (merr)
-            MTestPrintError(merr);
+        int i, j;
+
+        /* Get datatype information and dataset */
+        datatype_decode(mtype, &extent, &totspace, &totsize);
+        init_dataset_params(dataset, totsize, &init_term, &common_diff);
 
-        size = lb + extent;
-        nc = 0;
         dt_offset = 0;
+        data = init_term;
         /* For each datatype */
         for (k = 0; k < mtype->count; k++) {
             /* For each block */
@@ -423,7 +492,7 @@ static int MTestTypeIndexedCheckbuf(MTestDatatype * mtype)
                         + j * mtype->basesize;
                     /* For each byte in the element */
                     for (b = 0; b < mtype->basesize; b++) {
-                        expected = (unsigned char) (0xff ^ (nc++ & 0xff));
+                        expected = (unsigned char) (0xff ^ ((data++ * common_diff) & 0xff));
                         if (p[offset + b] != expected) {
                             err++;
                             if (mtype->printErrors && err < 10) {
@@ -435,7 +504,7 @@ static int MTestTypeIndexedCheckbuf(MTestDatatype * mtype)
                     }
                 }
             }
-            dt_offset += size;
+            dt_offset += extent;
         }
     }
     return err;
@@ -448,25 +517,23 @@ static int MTestTypeIndexedCheckbuf(MTestDatatype * mtype)
 /*
  * Initialize buffer of indexed-block datatype
  */
-static void *MTestTypeIndexedBlockInit(MTestDatatype * mtype)
+static void *MTestTypeIndexedBlockInit(MTestDatatype * mtype, MTestDataset dataset)
 {
-    MPI_Aint extent = 0, lb = 0, size, totsize, offset, dt_offset;
-    int merr;
+    MPI_Aint totspace = 0, extent = 0, offset, dt_offset;
+    MPI_Aint init_term = 0, common_diff = 0, data = 0, totsize = 0;
 
     if (mtype->count > 0) {
         unsigned char *p;
         MPI_Aint k, j;
-        int i, nc;
+        int i;
 
-        /* Allocate the send/recv buffer */
-        merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
-        if (merr)
-            MTestPrintError(merr);
-        size = extent + lb;
-        totsize = size * mtype->count;
+        /* Get datatype information and dataset */
+        datatype_decode(mtype, &extent, &totspace, &totsize);
+        init_dataset_params(dataset, totsize, &init_term, &common_diff);
 
+        /* Allocate buffer */
         if (!mtype->buf) {
-            mtype->buf = (void *) malloc(totsize);
+            mtype->buf = (void *) malloc(totspace);
         }
         p = (unsigned char *) (mtype->buf);
         if (!p) {
@@ -476,12 +543,16 @@ static void *MTestTypeIndexedBlockInit(MTestDatatype * mtype)
         }
 
         /* First, set to -1 */
-        for (k = 0; k < totsize; k++)
+        for (k = 0; k < totspace; k++)
             p[k] = 0xff;
 
-        /* Now, set the actual elements to the successive values.
+        /* For empty initialization, it is done. */
+        if (dataset == MTEST_DATA_EMPTY)
+            return mtype->buf;
+
+        /* Now, set value into actual elements.
          * We require that the base type is a contiguous type */
-        nc = 0;
+        data = init_term;
         dt_offset = 0;
         /* For each datatype */
         for (k = 0; k < mtype->count; k++) {
@@ -490,10 +561,10 @@ static void *MTestTypeIndexedBlockInit(MTestDatatype * mtype)
                 offset = dt_offset + mtype->displ_in_bytes[i];
                 /* For each byte in the block */
                 for (j = 0; j < mtype->blksize; j++) {
-                    p[offset + j] = (unsigned char) (0xff ^ (nc++ & 0xff));
+                    p[offset + j] = (unsigned char) (0xff ^ ((data++ * common_diff) & 0xff));
                 }
             }
-            dt_offset += size;
+            dt_offset += extent;
         }
     }
     else {
@@ -509,24 +580,26 @@ static void *MTestTypeIndexedBlockInit(MTestDatatype * mtype)
 /*
  * Check value of received indexed-block datatype buffer
  */
-static int MTestTypeIndexedBlockCheckbuf(MTestDatatype * mtype)
+static int MTestTypeIndexedBlockCheckbuf(MTestDatatype * mtype, MTestDataset dataset)
 {
     unsigned char *p;
     unsigned char expected;
-    int err = 0, merr;
-    MPI_Aint size = 0, offset, dt_offset, lb = 0, extent = 0;
+    MPI_Aint dt_offset, offset;
+    MPI_Aint totspace = 0, extent = 0;
+    MPI_Aint init_term = 0, common_diff = 0, data = 0, totsize = 0;
+    int err = 0;
 
     p = (unsigned char *) mtype->buf;
     if (p) {
         MPI_Aint j, k;
-        int i, nc;
-        merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
-        if (merr)
-            MTestPrintError(merr);
+        int i;
+
+        /* Get datatype information and dataset */
+        datatype_decode(mtype, &extent, &totspace, &totsize);
+        init_dataset_params(dataset, totsize, &init_term, &common_diff);
 
-        size = lb + extent;
-        nc = 0;
         dt_offset = 0;
+        data = init_term;
         /* For each datatype */
         for (k = 0; k < mtype->count; k++) {
             /* For each block */
@@ -534,18 +607,18 @@ static int MTestTypeIndexedBlockCheckbuf(MTestDatatype * mtype)
                 offset = dt_offset + mtype->displ_in_bytes[i];
                 /* For each byte in the block */
                 for (j = 0; j < mtype->blksize; j++) {
-                    expected = (unsigned char) (0xff ^ (nc++ & 0xff));
+                    expected = (unsigned char) (0xff ^ ((data++ * common_diff) & 0xff));
                     if (p[offset + j] != expected) {
                         err++;
                         if (mtype->printErrors && err < 10) {
-                            printf("Data expected = %x but got p[%d,%d] = %x\n",
+                            printf("Data expected = %x but got p[%d,%ld] = %x\n",
                                    expected, i, j, p[offset + j]);
                             fflush(stdout);
                         }
                     }
                 }
             }
-            dt_offset += size;
+            dt_offset += extent;
         }
     }
     return err;
@@ -558,26 +631,23 @@ static int MTestTypeIndexedBlockCheckbuf(MTestDatatype * mtype)
 /*
  * Initialize buffer of subarray datatype.
  */
-static void *MTestTypeSubarrayInit(MTestDatatype * mtype)
+static void *MTestTypeSubarrayInit(MTestDatatype * mtype, MTestDataset dataset)
 {
-    MPI_Aint extent = 0, lb = 0, size, totsize, offset, dt_offset, byte_offset;
-    int merr;
+    MPI_Aint totspace = 0, extent = 0, offset, dt_offset, byte_offset;
+    MPI_Aint init_term = 0, common_diff = 0, data = 0, totsize = 0;
 
     if (mtype->count > 0) {
         unsigned char *p;
         MPI_Aint k;
-        int j, b, i, nc;
+        int j, b, i;
 
-        /* Allocate the send/recv buffer */
-        merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
-        if (merr)
-            MTestPrintError(merr);
-
-        size = extent + lb;
-        totsize = size * mtype->count;
+        /* Get datatype information and dataset */
+        datatype_decode(mtype, &extent, &totspace, &totsize);
+        init_dataset_params(dataset, totsize, &init_term, &common_diff);
 
+        /* Allocate buffer */
         if (!mtype->buf) {
-            mtype->buf = (void *) malloc(totsize);
+            mtype->buf = (void *) malloc(totspace);
         }
         p = (unsigned char *) (mtype->buf);
         if (!p) {
@@ -587,10 +657,14 @@ static void *MTestTypeSubarrayInit(MTestDatatype * mtype)
         }
 
         /* First, set to -1 */
-        for (k = 0; k < totsize; k++)
+        for (k = 0; k < totspace; k++)
             p[k] = 0xff;
 
-        /* Now, set the actual elements to the successive values.
+        /* For empty initialization, it is done. */
+        if (dataset == MTEST_DATA_EMPTY)
+            return mtype->buf;
+
+        /* Now, set value into actual elements.
          * We require that the base type is a contiguous type. */
         int ncol, sub_ncol, sub_nrow, sub_col_start, sub_row_start;
         ncol = mtype->arr_sizes[1];
@@ -599,7 +673,7 @@ static void *MTestTypeSubarrayInit(MTestDatatype * mtype)
         sub_row_start = mtype->arr_starts[0];
         sub_col_start = mtype->arr_starts[1];
 
-        nc = 0;
+        data = init_term;
         dt_offset = 0;
         /* For each datatype */
         for (k = 0; k < mtype->count; k++) {
@@ -611,10 +685,11 @@ static void *MTestTypeSubarrayInit(MTestDatatype * mtype)
                     byte_offset = dt_offset + (offset + j) * mtype->basesize;
                     /* For each byte in element */
                     for (b = 0; b < mtype->basesize; b++)
-                        p[byte_offset + b] = (unsigned char) (0xff ^ (nc++ & 0xff));
+                        p[byte_offset + b] =
+                            (unsigned char) (0xff ^ ((data++ * common_diff) & 0xff));
                 }
             }
-            dt_offset += size;
+            dt_offset += extent;
         }
     }
     else {
@@ -630,22 +705,22 @@ static void *MTestTypeSubarrayInit(MTestDatatype * mtype)
 /*
  * Check value of received subarray datatype buffer
  */
-static int MTestTypeSubarrayCheckbuf(MTestDatatype * mtype)
+static int MTestTypeSubarrayCheckbuf(MTestDatatype * mtype, MTestDataset dataset)
 {
     unsigned char *p;
     unsigned char expected;
-    int err = 0, merr;
-    MPI_Aint size, offset, dt_offset, byte_offset, lb = 0, extent = 0;
+    int err = 0;
+    MPI_Aint totspace = 0, extent = 0, offset, dt_offset, byte_offset;
+    MPI_Aint init_term = 0, common_diff = 0, data = 0, totsize = 0;
 
     p = (unsigned char *) mtype->buf;
     if (p) {
         MPI_Aint k;
-        int j, b, i, nc;
-        merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
-        if (merr)
-            MTestPrintError(merr);
+        int j, b, i;
 
-        size = lb + extent;
+        /* Get datatype information and dataset */
+        datatype_decode(mtype, &extent, &totspace, &totsize);
+        init_dataset_params(dataset, totsize, &init_term, &common_diff);
 
         int ncol, sub_ncol, sub_nrow, sub_col_start, sub_row_start;
         ncol = mtype->arr_sizes[1];
@@ -654,7 +729,7 @@ static int MTestTypeSubarrayCheckbuf(MTestDatatype * mtype)
         sub_row_start = mtype->arr_starts[0];
         sub_col_start = mtype->arr_starts[1];
 
-        nc = 0;
+        data = init_term;
         dt_offset = 0;
         /* For each datatype */
         for (k = 0; k < mtype->count; k++) {
@@ -666,7 +741,7 @@ static int MTestTypeSubarrayCheckbuf(MTestDatatype * mtype)
                     byte_offset = dt_offset + (offset + j) * mtype->basesize;
                     /* For each byte in element */
                     for (b = 0; b < mtype->basesize; b++) {
-                        expected = (unsigned char) (0xff ^ (nc++ & 0xff));
+                        expected = (unsigned char) (0xff ^ ((data++ * common_diff) & 0xff));
                         if (p[byte_offset + b] != expected) {
                             err++;
                             if (mtype->printErrors && err < 10) {
@@ -678,7 +753,7 @@ static int MTestTypeSubarrayCheckbuf(MTestDatatype * mtype)
                     }
                 }
             }
-            dt_offset += size;
+            dt_offset += extent;
         }
     }
     if (err)
@@ -1341,48 +1416,6 @@ int MTestTypeDupCreate(MPI_Datatype oldtype, MTestDatatype * mtype)
     return merr;
 }
 
-
-/*
- * General initialization for receive buffer.
- * Allocate buffer and initialize for reception (e.g., set initial data to detect failure)
- * Both basic and derived datatype can be handled by using extent as buffer size.
- */
-void *MTestTypeInitRecv(MTestDatatype * mtype)
-{
-    MPI_Aint size, extent = 0, lb = 0;
-    int merr;
-
-    if (mtype->count > 0) {
-        signed char *p;
-        MPI_Aint i, totsize;
-        merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
-        if (merr)
-            MTestPrintError(merr);
-
-        size = extent + lb;
-        totsize = size * mtype->count;
-        if (!mtype->buf) {
-            mtype->buf = (void *) malloc(totsize);
-        }
-        p = (signed char *) (mtype->buf);
-        if (!p) {
-            char errmsg[128] = { 0 };
-            sprintf(errmsg, "Out of memory in %s", __FUNCTION__);
-            MTestError(errmsg);
-        }
-        for (i = 0; i < totsize; i++) {
-            p[i] = 0xff;
-        }
-    }
-    else {
-        if (mtype->buf) {
-            free(mtype->buf);
-        }
-        mtype->buf = 0;
-    }
-    return mtype->buf;
-}
-
 void MTestTypeCreatorInit(MTestDdtCreator * creators)
 {
     memset(creators, 0, sizeof(MTestDdtCreator) * MTEST_DDT_MAX);
diff --git a/test/mpi/util/mtest_datatype.h b/test/mpi/util/mtest_datatype.h
index e549406..939df18 100644
--- a/test/mpi/util/mtest_datatype.h
+++ b/test/mpi/util/mtest_datatype.h
@@ -54,7 +54,6 @@ typedef int (*MTestDdtCreator) (int, int, int, int, MPI_Datatype, const char *,
 
 extern void MTestTypeCreatorInit(MTestDdtCreator * creators);
 extern void MTestTypeMinCreatorInit(MTestDdtCreator * creators);
-extern void *MTestTypeInitRecv(MTestDatatype * mtype);
 
 extern int MTestTypeBasicCreate(MPI_Datatype oldtype, MTestDatatype * mtype);
 extern int MTestTypeDupCreate(MPI_Datatype oldtype, MTestDatatype * mtype);
diff --git a/test/mpi/util/mtest_datatype_gen.c b/test/mpi/util/mtest_datatype_gen.c
index 6b8a5e1..12a3d57 100644
--- a/test/mpi/util/mtest_datatype_gen.c
+++ b/test/mpi/util/mtest_datatype_gen.c
@@ -521,11 +521,6 @@ int MTestGetDatatypes(MTestDatatype * sendtype, MTestDatatype * recvtype, MPI_Ai
         datatype_index = -1;
     }
 
-    if (datatype_index > 0) {
-        /* general initialization for receive buffer. */
-        recvtype->InitBuf = MTestTypeInitRecv;
-    }
-
     datatype_index++;
 
     if (verbose >= 2 && datatype_index > 0) {
@@ -584,9 +579,11 @@ void MTestFreeDatatype(MTestDatatype * mtype)
     }
 }
 
-/* Check that a message was received correctly.  Returns the number of
-   errors detected.  Status may be NULL or MPI_STATUS_IGNORE */
-int MTestCheckRecv(MPI_Status * status, MTestDatatype * recvtype)
+/* Check that a message was received correctly.
+ * - status may be NULL or MPI_STATUS_IGNORE;
+ * - specify dataset used to be compared;
+ * - returns the number of errors detected. */
+int MTestCheckRecv(MPI_Status * status, MTestDatatype * recvtype, MTestDataset dataset)
 {
     int count;
     int errs = 0, merr;
@@ -603,7 +600,7 @@ int MTestCheckRecv(MPI_Status * status, MTestDatatype * recvtype)
     }
 
     /* Check received data */
-    if (!errs && recvtype->CheckBuf(recvtype)) {
+    if (!errs && recvtype->CheckBuf(recvtype, dataset)) {
         errs++;
     }
     return errs;

http://git.mpich.org/mpich.git/commitdiff/3ed5c1a234069cc719e8f54adc06a9d4b7b5a2f1

commit 3ed5c1a234069cc719e8f54adc06a9d4b7b5a2f1
Author: Min Si <msi at il.is.s.u-tokyo.ac.jp>
Date:   Mon Jul 27 23:30:53 2015 -0500

    Added Duplicate function for MTest datatype objects.
    
    Some special tests want to check another buffer but not only
    the send/receive buffers. For example, get_acc tests want to check
    the result buffer as well. This patch allows the test to duplicate
    a datatype object from existing send or receive buffer, thus the
    mtest init/check routine can be simply reused.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/test/mpi/include/mpitest.h b/test/mpi/include/mpitest.h
index 8293b28..1440f4e 100644
--- a/test/mpi/include/mpitest.h
+++ b/test/mpi/include/mpitest.h
@@ -40,6 +40,8 @@ typedef struct _MTestDatatype {
     void *buf;              /* buffer to use in communication */
     MPI_Aint  count;        /* count to use for this datatype */
     int  isBasic;           /* true if the type is predefined */
+    int  isDuped;           /* true if the type is duplicated from
+                             * an existing derived datatype */
     int  printErrors;       /* true if errors should be printed
 			       (used by the CheckBuf routines) */
     /* The following is optional data that is used by some of
@@ -55,6 +57,7 @@ typedef struct _MTestDatatype {
     void *(*InitBuf)( struct _MTestDatatype * );
     void *(*FreeBuf)( struct _MTestDatatype * );
     int   (*CheckBuf)( struct _MTestDatatype * );
+    int   (*Dup)( struct _MTestDatatype, struct _MTestDatatype * );
 } MTestDatatype;
 
 /* The max value of count must be very large to ensure that we
diff --git a/test/mpi/util/mtest_datatype.c b/test/mpi/util/mtest_datatype.c
index c42d508..6624b19 100644
--- a/test/mpi/util/mtest_datatype.c
+++ b/test/mpi/util/mtest_datatype.c
@@ -37,14 +37,19 @@ static void *MTestTypeFree(MTestDatatype * mtype)
 {
     if (mtype->buf)
         free(mtype->buf);
-    if (mtype->displs)
-        free(mtype->displs);
-    if (mtype->displ_in_bytes)
-        free(mtype->displ_in_bytes);
-    if (mtype->index)
-        free(mtype->index);
-    if (mtype->old_datatypes)
-        free(mtype->old_datatypes);
+
+    /* Only free internal structures for created types. */
+    if (!mtype->isBasic && !mtype->isDuped) {
+        if (mtype->displs)
+            free(mtype->displs);
+        if (mtype->displ_in_bytes)
+            free(mtype->displ_in_bytes);
+        if (mtype->index)
+            free(mtype->index);
+        if (mtype->old_datatypes)
+            free(mtype->old_datatypes);
+    }
+
     mtype->buf = NULL;
     mtype->displs = NULL;
     mtype->displ_in_bytes = NULL;
@@ -57,6 +62,7 @@ static void *MTestTypeFree(MTestDatatype * mtype)
 static inline void MTestTypeReset(MTestDatatype * mtype)
 {
     mtype->isBasic = 0;
+    mtype->isDuped = 0;
     mtype->printErrors = 0;
     mtype->buf = NULL;
 
@@ -85,6 +91,52 @@ static inline void MTestTypeReset(MTestDatatype * mtype)
     mtype->InitBuf = NULL;
     mtype->FreeBuf = NULL;
     mtype->CheckBuf = NULL;
+    mtype->Dup = NULL;
+}
+
+/*
+ * Duplicate a MTest datatype object.
+ *
+ * Note that we only set all the structure pointers to the existing objects,
+ * only the buffer is allocated separately.
+ * */
+static int MTestTypeDup(MTestDatatype old_mtype, MTestDatatype * new_mtype)
+{
+    int merr = 0;
+
+    MTestTypeReset(new_mtype);
+
+    new_mtype->isDuped = 1;
+
+    /* Copy all internal structures from old type. */
+    new_mtype->datatype = old_mtype.datatype;
+    new_mtype->count = old_mtype.count;
+    new_mtype->nblock = old_mtype.nblock;
+    new_mtype->index = old_mtype.index;
+
+    new_mtype->stride = old_mtype.stride;
+    new_mtype->blksize = old_mtype.blksize;
+    new_mtype->displ_in_bytes = old_mtype.displ_in_bytes;
+
+    new_mtype->displs = old_mtype.displs;
+    new_mtype->basesize = old_mtype.basesize;
+
+    new_mtype->old_datatypes = old_mtype.old_datatypes;
+
+    new_mtype->arr_sizes[0] = old_mtype.arr_sizes[0];
+    new_mtype->arr_sizes[1] = old_mtype.arr_sizes[1];
+    new_mtype->arr_subsizes[0] = old_mtype.arr_subsizes[0];
+    new_mtype->arr_subsizes[1] = old_mtype.arr_subsizes[1];
+    new_mtype->arr_starts[0] = old_mtype.arr_starts[0];
+    new_mtype->arr_starts[1] = old_mtype.arr_starts[1];
+    new_mtype->order = old_mtype.order;
+
+    new_mtype->InitBuf = old_mtype.InitBuf;
+    new_mtype->FreeBuf = old_mtype.FreeBuf;
+    new_mtype->CheckBuf = old_mtype.CheckBuf;
+    new_mtype->Dup = old_mtype.Dup;
+
+    return merr;
 }
 
 /* ------------------------------------------------------------------------ */
@@ -680,6 +732,7 @@ static int MTestTypeContiguousCreate(int nblock, int blocklen, int stride, int l
     mtype->InitBuf = MTestTypeContigInit;
     mtype->FreeBuf = MTestTypeFree;
     mtype->CheckBuf = MTestTypeContigCheckbuf;
+    mtype->Dup = MTestTypeDup;
     return merr;
 }
 
@@ -729,6 +782,7 @@ static int MTestTypeVectorCreate(int nblock, int blocklen, int stride, int lb,
     mtype->InitBuf = MTestTypeVectorInit;
     mtype->FreeBuf = MTestTypeFree;
     mtype->CheckBuf = MTestTypeVectorCheckbuf;
+    mtype->Dup = MTestTypeDup;
     return merr;
 }
 
@@ -779,6 +833,7 @@ static int MTestTypeHvectorCreate(int nblock, int blocklen, int stride, int lb,
     mtype->InitBuf = MTestTypeVectorInit;
     mtype->FreeBuf = MTestTypeFree;
     mtype->CheckBuf = MTestTypeVectorCheckbuf;
+    mtype->Dup = MTestTypeDup;
 
     return merr;
 }
@@ -842,6 +897,7 @@ static int MTestTypeIndexedCreate(int nblock, int blocklen, int stride, int lb,
     mtype->InitBuf = MTestTypeIndexedInit;
     mtype->FreeBuf = MTestTypeFree;
     mtype->CheckBuf = MTestTypeIndexedCheckbuf;
+    mtype->Dup = MTestTypeDup;
 
     return merr;
 }
@@ -905,6 +961,7 @@ static inline int MTestTypeHindexedCreate(int nblock, int blocklen, int stride,
     mtype->InitBuf = MTestTypeIndexedInit;
     mtype->FreeBuf = MTestTypeFree;
     mtype->CheckBuf = MTestTypeIndexedCheckbuf;
+    mtype->Dup = MTestTypeDup;
 
     return merr;
 }
@@ -969,6 +1026,7 @@ static int MTestTypeIndexedBlockCreate(int nblock, int blocklen, int stride, int
     mtype->InitBuf = MTestTypeIndexedBlockInit;
     mtype->FreeBuf = MTestTypeFree;
     mtype->CheckBuf = MTestTypeIndexedBlockCheckbuf;
+    mtype->Dup = MTestTypeDup;
 
     return merr;
 }
@@ -1031,6 +1089,7 @@ static int MTestTypeHindexedBlockCreate(int nblock, int blocklen, int stride, in
     mtype->InitBuf = MTestTypeIndexedBlockInit;
     mtype->FreeBuf = MTestTypeFree;
     mtype->CheckBuf = MTestTypeIndexedBlockCheckbuf;
+    mtype->Dup = MTestTypeDup;
 
     return merr;
 }
@@ -1097,6 +1156,7 @@ static int MTestTypeStructCreate(int nblock, int blocklen, int stride, int lb,
     mtype->InitBuf = MTestTypeIndexedInit;
     mtype->FreeBuf = MTestTypeFree;
     mtype->CheckBuf = MTestTypeIndexedCheckbuf;
+    mtype->Dup = MTestTypeDup;
 
     return merr;
 }
@@ -1153,6 +1213,7 @@ static int MTestTypeSubArrayOrderCCreate(int nblock, int blocklen, int stride, i
     mtype->InitBuf = MTestTypeSubarrayInit;
     mtype->FreeBuf = MTestTypeFree;
     mtype->CheckBuf = MTestTypeSubarrayCheckbuf;
+    mtype->Dup = MTestTypeDup;
 
     return merr;
 }
@@ -1217,6 +1278,7 @@ static int MTestTypeSubArrayOrderFortranCreate(int nblock, int blocklen, int str
     mtype->InitBuf = MTestTypeSubarrayInit;
     mtype->FreeBuf = MTestTypeFree;
     mtype->CheckBuf = MTestTypeSubarrayCheckbuf;
+    mtype->Dup = MTestTypeDup;
 
     return merr;
 }
@@ -1243,6 +1305,7 @@ int MTestTypeBasicCreate(MPI_Datatype oldtype, MTestDatatype * mtype)
     mtype->InitBuf = MTestTypeContigInit;
     mtype->FreeBuf = MTestTypeFree;
     mtype->CheckBuf = MTestTypeContigCheckbuf;
+    mtype->Dup = MTestTypeDup;
 
     return merr;
 }
@@ -1273,6 +1336,7 @@ int MTestTypeDupCreate(MPI_Datatype oldtype, MTestDatatype * mtype)
     mtype->InitBuf = MTestTypeContigInit;
     mtype->FreeBuf = MTestTypeFree;
     mtype->CheckBuf = MTestTypeContigCheckbuf;
+    mtype->Dup = MTestTypeDup;
 
     return merr;
 }
diff --git a/test/mpi/util/mtest_datatype_gen.c b/test/mpi/util/mtest_datatype_gen.c
index 11eb0de..6b8a5e1 100644
--- a/test/mpi/util/mtest_datatype_gen.c
+++ b/test/mpi/util/mtest_datatype_gen.c
@@ -576,8 +576,8 @@ void MTestFreeDatatype(MTestDatatype * mtype)
     if (mtype->FreeBuf) {
         (mtype->FreeBuf) (mtype);
     }
-    /* Free the datatype itself if it was created */
-    if (!mtype->isBasic) {
+    /* Free the datatype itself if it was a created new datatype */
+    if (!mtype->isBasic && !mtype->isDuped) {
         merr = MPI_Type_free(&mtype->datatype);
         if (merr)
             MTestPrintError(merr);

http://git.mpich.org/mpich.git/commitdiff/1db4d29375e00590cd41552d88c999b144791a70

commit 1db4d29375e00590cd41552d88c999b144791a70
Author: Min Si <msi at il.is.s.u-tokyo.ac.jp>
Date:   Fri Jul 24 11:15:57 2015 -0500

    Fixed compile warning in mpi rma tests and mtest datatype routine.
    
    This patch fixed compile warnings such as unused variables, mismatched
    string formats, and inconsistent variable types in test/mpi/rma/* and
    mtest datatype routine. This patch also completed the initialization for
    all fields in mtest datatype structure.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/test/mpi/include/mpitest.h b/test/mpi/include/mpitest.h
index 594f58e..8293b28 100644
--- a/test/mpi/include/mpitest.h
+++ b/test/mpi/include/mpitest.h
@@ -65,11 +65,11 @@ typedef struct _MTestDatatype {
 
 /* Setup the full version of datatype tests.
  * It generate tests for all basic datatypes and all derived datatypes except darray. */
-void MTestInitFullDatatypes();
+void MTestInitFullDatatypes(void);
 
 /* Setup the minimum version of datatype tests.
  * It generate tests for all basic datatypes, vector and indexed. */
-void MTestInitMinDatatypes();
+void MTestInitMinDatatypes(void);
 
 int MTestCheckRecv( MPI_Status *, MTestDatatype * );
 int MTestGetDatatypes( MTestDatatype *, MTestDatatype *, MPI_Aint );
diff --git a/test/mpi/rma/accfence2.c b/test/mpi/rma/accfence2.c
index 4bf0f93..4366e10 100644
--- a/test/mpi/rma/accfence2.c
+++ b/test/mpi/rma/accfence2.c
@@ -20,11 +20,10 @@ static char MTEST_Descrip[] = "Test MPI_Accumulate with fence";
 int main( int argc, char *argv[] )
 {
     int errs = 0;
-    int rank, size, source, dest;
+    int rank, size, source;
     int minsize = 2, count, i; 
     MPI_Comm      comm;
     MPI_Win       win;
-    MPI_Datatype  datatype;
     int           *winbuf, *sbuf;
 
     MTest_Init( &argc, &argv );
@@ -39,10 +38,8 @@ int main( int argc, char *argv[] )
 	MPI_Comm_rank( comm, &rank );
 	MPI_Comm_size( comm, &size );
 	source = 0;
-	dest   = size - 1;
 	
 	for (count = 1; count < 65000; count = count * 2) {
-	    datatype = MPI_INT;
 	    /* We compare with an integer value that can be as large as
 	       size * (count * count + (1/2)*(size-1))
 	       For large machines (size large), this can exceed the 
diff --git a/test/mpi/rma/accfence2_am.c b/test/mpi/rma/accfence2_am.c
index 11d2fb7..b081b2c 100644
--- a/test/mpi/rma/accfence2_am.c
+++ b/test/mpi/rma/accfence2_am.c
@@ -22,11 +22,10 @@ static char MTEST_Descrip[] = "Test MPI_Accumulate with fence";
 int main( int argc, char *argv[] )
 {
     int errs = 0;
-    int rank, size, source, dest;
+    int rank, size, source;
     int minsize = 2, count, i; 
     MPI_Comm      comm;
     MPI_Win       win;
-    MPI_Datatype  datatype;
     int           *winbuf, *sbuf;
 
     MTest_Init( &argc, &argv );
@@ -41,10 +40,8 @@ int main( int argc, char *argv[] )
 	MPI_Comm_rank( comm, &rank );
 	MPI_Comm_size( comm, &size );
 	source = 0;
-	dest   = size - 1;
 	
 	for (count = 32768; count < 65000; count = count * 2) {
-	    datatype = MPI_INT;
 
 	    /* We compare with an integer value that can be as large as
 	       size * (count * count + (1/2)*(size-1))
diff --git a/test/mpi/rma/atomic_rmw_cas.c b/test/mpi/rma/atomic_rmw_cas.c
index 31968ae..dfd7228 100644
--- a/test/mpi/rma/atomic_rmw_cas.c
+++ b/test/mpi/rma/atomic_rmw_cas.c
@@ -27,14 +27,13 @@
 
 int main(int argc, char *argv[])
 {
-    int rank, size, i, j, k;
+    int rank, size, k;
     int errors = 0;
     int origin_shm, origin_am, dest;
     int *orig_buf = NULL, *result_buf = NULL, *compare_buf = NULL,
         *target_buf = NULL, *check_buf = NULL;
     int target_value = 0;
     MPI_Win win;
-    MPI_Status status;
 
     MPI_Init(&argc, &argv);
 
diff --git a/test/mpi/rma/atomic_rmw_gacc.c b/test/mpi/rma/atomic_rmw_gacc.c
index 87f5c35..0e73e2d 100644
--- a/test/mpi/rma/atomic_rmw_gacc.c
+++ b/test/mpi/rma/atomic_rmw_gacc.c
@@ -79,7 +79,7 @@ void checkResults(int loop_k, int *errors)
 
 int main(int argc, char *argv[])
 {
-    int i, j, k;
+    int i, k;
     int errors = 0, all_errors = 0;
     int my_buf_num;
     MPI_Datatype origin_dtp, target_dtp;
diff --git a/test/mpi/rma/compare_and_swap.c b/test/mpi/rma/compare_and_swap.c
index 96eace1..2a678a5 100644
--- a/test/mpi/rma/compare_and_swap.c
+++ b/test/mpi/rma/compare_and_swap.c
@@ -15,7 +15,7 @@
 #define ITER 100
 
 int main(int argc, char **argv) {
-    int       i, j, rank, nproc;
+    int       i, rank, nproc;
     int       errors = 0, all_errors = 0;
     int      *val_ptr;
     MPI_Win   win;
diff --git a/test/mpi/rma/derived-acc-flush_local.c b/test/mpi/rma/derived-acc-flush_local.c
index 97668db..a45ef06 100644
--- a/test/mpi/rma/derived-acc-flush_local.c
+++ b/test/mpi/rma/derived-acc-flush_local.c
@@ -25,7 +25,7 @@
 int main(int argc, char *argv[])
 {
     int rank, nproc;
-    int i, j;
+    int i;
     MPI_Win win;
     int *tar_buf = NULL;
     int *orig_buf = NULL;
diff --git a/test/mpi/rma/fkeyvalwin.c b/test/mpi/rma/fkeyvalwin.c
index 7aed170..d2dd967 100644
--- a/test/mpi/rma/fkeyvalwin.c
+++ b/test/mpi/rma/fkeyvalwin.c
@@ -50,7 +50,7 @@ int main( int argc, char *argv[] )
 {
     int errs = 0;
     int attrval;
-    int i, key[32], keyval, saveKeyval;
+    int i, key[32], keyval;
     MPI_Win win;
     MTest_Init( &argc, &argv );
 
@@ -58,7 +58,6 @@ int main( int argc, char *argv[] )
 	if (win == MPI_WIN_NULL) continue;
 
 	MPI_Win_create_keyval( copy_fn, delete_fn, &keyval, (void *)0 );
-	saveKeyval = keyval;   /* in case we need to free explicitly */
 	attrval = 1;
 	MPI_Win_set_attr( win, keyval, (void*)&attrval );
 	/* See MPI-1, 5.7.1.  Freeing the keyval does not remove it if it
diff --git a/test/mpi/rma/large-small-acc.c b/test/mpi/rma/large-small-acc.c
index 17c7993..de5b08f 100644
--- a/test/mpi/rma/large-small-acc.c
+++ b/test/mpi/rma/large-small-acc.c
@@ -84,4 +84,5 @@ int main(int argc, char *argv[])
     }
 
     MPI_Finalize();
+    return 0;
 }
diff --git a/test/mpi/rma/linked_list_fop.c b/test/mpi/rma/linked_list_fop.c
index bb95b77..7df6e35 100644
--- a/test/mpi/rma/linked_list_fop.c
+++ b/test/mpi/rma/linked_list_fop.c
@@ -148,8 +148,6 @@ int main(int argc, char **argv) {
                 /* Tail pointer is stale, fetch the displacement.  May take multiple tries
                    if it is being updated. */
                 do {
-                    MPI_Aint junk = 0;
-
                     MPI_Win_lock(MPI_LOCK_SHARED, tail_ptr.rank, MPI_MODE_NOCHECK, llist_win);
 
                     MPI_Fetch_and_op(NULL, &next_tail_ptr.disp, MPI_AINT, tail_ptr.rank,
diff --git a/test/mpi/rma/lock_dt_flush.c b/test/mpi/rma/lock_dt_flush.c
index 9613c92..336da04 100644
--- a/test/mpi/rma/lock_dt_flush.c
+++ b/test/mpi/rma/lock_dt_flush.c
@@ -16,6 +16,7 @@ static char MTEST_Descrip[] = "Test for streaming ACC-like operations with lock+
 int main(int argc, char *argv[])
 {
     int errs = 0;
+    int err = 0;
     int rank, size, source, dest;
     int minsize = 2, count;
     MPI_Comm comm;
@@ -77,7 +78,7 @@ int main(int argc, char *argv[])
 
                     MPI_Barrier(comm);
                     MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
-                    int err = MTestCheckRecv(0, &recvtype);
+                    err = MTestCheckRecv(0, &recvtype);
                     if (err)
                         errs++;
                     recvtype.InitBuf(&recvtype);
diff --git a/test/mpi/rma/lock_dt_flushlocal.c b/test/mpi/rma/lock_dt_flushlocal.c
index ffd24e1..fe6db8a 100644
--- a/test/mpi/rma/lock_dt_flushlocal.c
+++ b/test/mpi/rma/lock_dt_flushlocal.c
@@ -17,6 +17,7 @@ static char MTEST_Descrip[] = "Test for streaming ACC-like operations with lock+
 int main(int argc, char *argv[])
 {
     int errs = 0;
+    int err = 0;
     int rank, size, source, dest;
     int minsize = 2, count;
     MPI_Comm comm;
@@ -80,7 +81,7 @@ int main(int argc, char *argv[])
 
                     MPI_Barrier(comm);
                     MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
-                    int err = MTestCheckRecv(0, &recvtype);
+                    err = MTestCheckRecv(0, &recvtype);
                     if (err)
                         errs++;
                     recvtype.InitBuf(&recvtype);
diff --git a/test/mpi/rma/mutex_bench.c b/test/mpi/rma/mutex_bench.c
index d8a65e8..3bd955f 100644
--- a/test/mpi/rma/mutex_bench.c
+++ b/test/mpi/rma/mutex_bench.c
@@ -21,7 +21,7 @@ double delay_ctr = 0.0;
 
 int main(int argc, char ** argv) {
   int rank, nproc, i;
-  double t_mpix_mtx, t_mcs_mtx;
+  double t_mcs_mtx;
   MPI_Comm mtx_comm;
   MCS_Mutex mcs_mtx;
 
diff --git a/test/mpi/rma/win_dynamic_acc.c b/test/mpi/rma/win_dynamic_acc.c
index 2640edd..eef403d 100644
--- a/test/mpi/rma/win_dynamic_acc.c
+++ b/test/mpi/rma/win_dynamic_acc.c
@@ -16,7 +16,7 @@
 const int verbose = 0;
 
 int main(int argc, char **argv) {
-    int       i, j, rank, nproc;
+    int       i, rank, nproc;
     int       errors = 0, all_errors = 0;
     int       val = 0, one = 1;
     int       iter;
diff --git a/test/mpi/rma/win_info.c b/test/mpi/rma/win_info.c
index 7a3ee3a..c490a9f 100644
--- a/test/mpi/rma/win_info.c
+++ b/test/mpi/rma/win_info.c
@@ -13,7 +13,7 @@
 #define VERBOSE 0
 
 int main(int argc, char **argv) {
-    int      i, j, rank, nproc;
+    int      rank, nproc;
     MPI_Info info_in, info_out;
     int      errors = 0, all_errors = 0;
     MPI_Win  win;
diff --git a/test/mpi/rma/win_shared_put_flush_get.c b/test/mpi/rma/win_shared_put_flush_get.c
index 15f1c70..5c4cfcf 100644
--- a/test/mpi/rma/win_shared_put_flush_get.c
+++ b/test/mpi/rma/win_shared_put_flush_get.c
@@ -120,7 +120,7 @@ int main(int argc, char *argv[])
     MPI_Win_create(my_base, new_win_size, win_unit, MPI_INFO_NULL, MPI_COMM_WORLD, &win);
 
     if (verbose)
-        printf("%d --    new window my_base %p, size %ld\n", rank, my_base, new_win_size);
+        printf("%d --    new window my_base %p, size %d\n", rank, my_base, new_win_size);
 
     MPI_Barrier(MPI_COMM_WORLD);
 
diff --git a/test/mpi/rma/win_shared_zerobyte.c b/test/mpi/rma/win_shared_zerobyte.c
index d128641..329f0c0 100644
--- a/test/mpi/rma/win_shared_zerobyte.c
+++ b/test/mpi/rma/win_shared_zerobyte.c
@@ -15,7 +15,7 @@ const int verbose = 0;
 
 int main(int argc, char **argv)
 {
-    int i, j, rank, nproc;
+    int i, rank, nproc;
     int shm_rank, shm_nproc;
     MPI_Aint size;
     int errors = 0, all_errors = 0;
diff --git a/test/mpi/util/mtest_datatype.c b/test/mpi/util/mtest_datatype.c
index 249dedf..c42d508 100644
--- a/test/mpi/util/mtest_datatype.c
+++ b/test/mpi/util/mtest_datatype.c
@@ -45,28 +45,46 @@ static void *MTestTypeFree(MTestDatatype * mtype)
         free(mtype->index);
     if (mtype->old_datatypes)
         free(mtype->old_datatypes);
-    mtype->buf = 0;
-    mtype->displs = 0;
-    mtype->displ_in_bytes = 0;
-    mtype->index = 0;
-    mtype->old_datatypes = 0;
+    mtype->buf = NULL;
+    mtype->displs = NULL;
+    mtype->displ_in_bytes = NULL;
+    mtype->index = NULL;
+    mtype->old_datatypes = NULL;
 
     return 0;
 }
 
 static inline void MTestTypeReset(MTestDatatype * mtype)
 {
-    mtype->InitBuf = 0;
-    mtype->FreeBuf = 0;
-    mtype->CheckBuf = 0;
-    mtype->datatype = 0;
     mtype->isBasic = 0;
     mtype->printErrors = 0;
-    mtype->buf = 0;
-    mtype->index = 0;
-    mtype->displs = 0;
-    mtype->displ_in_bytes = 0;
-    mtype->old_datatypes = 0;
+    mtype->buf = NULL;
+
+    mtype->datatype = MPI_DATATYPE_NULL;
+    mtype->count = 0;
+    mtype->nblock = 0;
+    mtype->index = NULL;
+
+    mtype->stride = 0;
+    mtype->blksize = 0;
+    mtype->displ_in_bytes = NULL;
+
+    mtype->displs = NULL;
+    mtype->basesize = 0;
+
+    mtype->old_datatypes = NULL;
+
+    mtype->arr_sizes[0] = 0;
+    mtype->arr_sizes[1] = 0;
+    mtype->arr_subsizes[0] = 0;
+    mtype->arr_subsizes[1] = 0;
+    mtype->arr_starts[0] = 0;
+    mtype->arr_starts[1] = 0;
+    mtype->order = 0;
+
+    mtype->InitBuf = NULL;
+    mtype->FreeBuf = NULL;
+    mtype->CheckBuf = NULL;
 }
 
 /* ------------------------------------------------------------------------ */
@@ -158,8 +176,8 @@ static void *MTestTypeVectorInit(MTestDatatype * mtype)
 
     if (mtype->count > 0) {
         unsigned char *p;
-        int j, k, nc;
-        MPI_Aint i;
+        MPI_Aint k, j;
+        int i, nc;
 
         merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
         if (merr)
@@ -178,8 +196,8 @@ static void *MTestTypeVectorInit(MTestDatatype * mtype)
         }
 
         /* First, set to -1 */
-        for (i = 0; i < totsize; i++)
-            p[i] = 0xff;
+        for (k = 0; k < totsize; k++)
+            p[k] = 0xff;
 
         /* Now, set the actual elements to the successive values.
          * We require that the base type is a contiguous type */
@@ -217,7 +235,8 @@ static int MTestTypeVectorCheckbuf(MTestDatatype * mtype)
 
     p = (unsigned char *) mtype->buf;
     if (p) {
-        int j, k, nc;
+        MPI_Aint k, j;
+        int nc;
         merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
         if (merr)
             MTestPrintError(merr);
@@ -265,8 +284,8 @@ static void *MTestTypeIndexedInit(MTestDatatype * mtype)
 
     if (mtype->count > 0) {
         unsigned char *p;
-        int j, k, b, nc;
-        MPI_Aint i;
+        MPI_Aint k, b;
+        int i, j, nc;
 
         /* Allocate buffer */
         merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
@@ -287,8 +306,8 @@ static void *MTestTypeIndexedInit(MTestDatatype * mtype)
         }
 
         /* First, set to -1 */
-        for (i = 0; i < totsize; i++)
-            p[i] = 0xff;
+        for (k = 0; k < totsize; k++)
+            p[k] = 0xff;
 
         /* Now, set the actual elements to the successive values.
          * We require that the base type is a contiguous type */
@@ -333,7 +352,8 @@ static int MTestTypeIndexedCheckbuf(MTestDatatype * mtype)
 
     p = (unsigned char *) mtype->buf;
     if (p) {
-        int i, j, k, b, nc;
+        MPI_Aint k, b;
+        int i, j, nc;
         merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
         if (merr)
             MTestPrintError(merr);
@@ -383,8 +403,8 @@ static void *MTestTypeIndexedBlockInit(MTestDatatype * mtype)
 
     if (mtype->count > 0) {
         unsigned char *p;
-        int k, j, nc;
-        MPI_Aint i;
+        MPI_Aint k, j;
+        int i, nc;
 
         /* Allocate the send/recv buffer */
         merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
@@ -404,8 +424,8 @@ static void *MTestTypeIndexedBlockInit(MTestDatatype * mtype)
         }
 
         /* First, set to -1 */
-        for (i = 0; i < totsize; i++)
-            p[i] = 0xff;
+        for (k = 0; k < totsize; k++)
+            p[k] = 0xff;
 
         /* Now, set the actual elements to the successive values.
          * We require that the base type is a contiguous type */
@@ -446,7 +466,8 @@ static int MTestTypeIndexedBlockCheckbuf(MTestDatatype * mtype)
 
     p = (unsigned char *) mtype->buf;
     if (p) {
-        int i, j, k, nc;
+        MPI_Aint j, k;
+        int i, nc;
         merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
         if (merr)
             MTestPrintError(merr);
@@ -492,8 +513,8 @@ static void *MTestTypeSubarrayInit(MTestDatatype * mtype)
 
     if (mtype->count > 0) {
         unsigned char *p;
-        int k, j, b, nc;
-        MPI_Aint i;
+        MPI_Aint k;
+        int j, b, i, nc;
 
         /* Allocate the send/recv buffer */
         merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
@@ -514,8 +535,8 @@ static void *MTestTypeSubarrayInit(MTestDatatype * mtype)
         }
 
         /* First, set to -1 */
-        for (i = 0; i < totsize; i++)
-            p[i] = 0xff;
+        for (k = 0; k < totsize; k++)
+            p[k] = 0xff;
 
         /* Now, set the actual elements to the successive values.
          * We require that the base type is a contiguous type. */
@@ -566,7 +587,8 @@ static int MTestTypeSubarrayCheckbuf(MTestDatatype * mtype)
 
     p = (unsigned char *) mtype->buf;
     if (p) {
-        int j, k, i, b, nc;
+        MPI_Aint k;
+        int j, b, i, nc;
         merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
         if (merr)
             MTestPrintError(merr);
@@ -613,7 +635,7 @@ static int MTestTypeSubarrayCheckbuf(MTestDatatype * mtype)
 }
 
 /* ------------------------------------------------------------------------ */
-/* Datatype creators                                                      */
+/* Datatype creators                                                        */
 /* ------------------------------------------------------------------------ */
 
 /*
diff --git a/test/mpi/util/mtest_datatype_gen.c b/test/mpi/util/mtest_datatype_gen.c
index dfacdbd..11eb0de 100644
--- a/test/mpi/util/mtest_datatype_gen.c
+++ b/test/mpi/util/mtest_datatype_gen.c
@@ -118,7 +118,7 @@ static int MTEST_RECV_DDT_RANGE = 0;
 enum {
     MTEST_DATATYPE_TEST_LEVEL_FULL,
     MTEST_DATATYPE_TEST_LEVEL_MIN,
-    MTEST_DATATYPE_TEST_LEVEL_BASIC,
+    MTEST_DATATYPE_TEST_LEVEL_BASIC
 };
 
 /* current datatype test level */
@@ -160,7 +160,7 @@ static void MTestResetDatatypeGen()
     MTEST_BDT_START_IDX = -1;
 }
 
-void MTestInitFullDatatypes()
+void MTestInitFullDatatypes(void)
 {
     /* Do not allow to change datatype test level during loop.
      * Otherwise indexes will be wrong.
@@ -176,7 +176,7 @@ void MTestInitFullDatatypes()
     }
 }
 
-void MTestInitMinDatatypes()
+void MTestInitMinDatatypes(void)
 {
     /* Do not allow to change datatype test level during loop.
      * Otherwise indexes will be wrong.
@@ -192,7 +192,7 @@ void MTestInitMinDatatypes()
     }
 }
 
-void MTestInitBasicDatatypes()
+void MTestInitBasicDatatypes(void)
 {
     /* Do not allow to change datatype test level during loop.
      * Otherwise indexes will be wrong.
@@ -393,7 +393,6 @@ static inline int MTestGetSendDerivedDatatypes(MTestDatatype * sendtype,
 {
     int merr = 0;
     int ddt_datatype_index, ddt_c_dt;
-    MPI_Count tsize = 1;
     MPI_Aint blen, stride, count, align_tot_count, lb;
     MPI_Datatype old_type = MPI_DOUBLE;
 
@@ -439,7 +438,6 @@ static inline int MTestGetRecvDerivedDatatypes(MTestDatatype * sendtype,
 {
     int merr = 0;
     int ddt_datatype_index, ddt_c_dt;
-    MPI_Count tsize;
     MPI_Aint blen, stride, count, align_tot_count, lb;
     MPI_Datatype old_type = MPI_DOUBLE;
 

-----------------------------------------------------------------------

Summary of changes:
 test/mpi/coll/bcast.c                   |    6 +-
 test/mpi/include/mpitest.h              |   23 +-
 test/mpi/pt2pt/pingping.c               |    8 +-
 test/mpi/pt2pt/sendrecv1.c              |    8 +-
 test/mpi/pt2pt/sendself.c               |   16 +-
 test/mpi/rma/accfence1.c                |    6 +-
 test/mpi/rma/accfence2.c                |    5 +-
 test/mpi/rma/accfence2_am.c             |    5 +-
 test/mpi/rma/accpscw1.c                 |    6 +-
 test/mpi/rma/atomic_rmw_cas.c           |    3 +-
 test/mpi/rma/atomic_rmw_gacc.c          |    2 +-
 test/mpi/rma/compare_and_swap.c         |    2 +-
 test/mpi/rma/derived-acc-flush_local.c  |    2 +-
 test/mpi/rma/epochtest.c                |   20 +-
 test/mpi/rma/fkeyvalwin.c               |    3 +-
 test/mpi/rma/getfence1.c                |    6 +-
 test/mpi/rma/large-small-acc.c          |    1 +
 test/mpi/rma/linked_list_fop.c          |    2 -
 test/mpi/rma/lock_contention_dt.c       |   10 +-
 test/mpi/rma/lock_dt.c                  |   10 +-
 test/mpi/rma/lock_dt_flush.c            |   11 +-
 test/mpi/rma/lock_dt_flushlocal.c       |   13 +-
 test/mpi/rma/lockall_dt.c               |   10 +-
 test/mpi/rma/lockall_dt_flush.c         |   10 +-
 test/mpi/rma/lockall_dt_flushall.c      |   10 +-
 test/mpi/rma/lockall_dt_flushlocal.c    |   12 +-
 test/mpi/rma/lockall_dt_flushlocalall.c |   12 +-
 test/mpi/rma/mutex_bench.c              |    2 +-
 test/mpi/rma/putfence1.c                |    8 +-
 test/mpi/rma/putpscw1.c                 |    6 +-
 test/mpi/rma/win_dynamic_acc.c          |    2 +-
 test/mpi/rma/win_info.c                 |    2 +-
 test/mpi/rma/win_shared_put_flush_get.c |    2 +-
 test/mpi/rma/win_shared_zerobyte.c      |    2 +-
 test/mpi/template.c                     |    6 +-
 test/mpi/util/mtest_datatype.c          |  539 +++++++++++++++++++------------
 test/mpi/util/mtest_datatype.h          |    1 -
 test/mpi/util/mtest_datatype_gen.c      |   29 +-
 38 files changed, 470 insertions(+), 351 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list