Commit 5014a82c authored by Xin Zhao's avatar Xin Zhao
Browse files

Add more tests in test/mpi/rma/rmazero.c.



Add tests of using derived datatype in MPI_ACCUMULATE to
test handling of zero-byte transfer, because packet handler
of MPI_ACCUMULATE is differernt for predefined datatype and
derived datatype.
Signed-off-by: default avatarWesley Bland <wbland@mcs.anl.gov>
parent dc9275be
...@@ -105,6 +105,7 @@ int main( int argc, char *argv[] ) ...@@ -105,6 +105,7 @@ int main( int argc, char *argv[] )
MPI_Comm comm; MPI_Comm comm;
MPI_Win win; MPI_Win win;
MPI_Request req; MPI_Request req;
MPI_Datatype derived_dtp;
MTest_Init( &argc, &argv ); MTest_Init( &argc, &argv );
...@@ -127,6 +128,9 @@ int main( int argc, char *argv[] ) ...@@ -127,6 +128,9 @@ int main( int argc, char *argv[] )
MPI_Abort( MPI_COMM_WORLD, 1 ); MPI_Abort( MPI_COMM_WORLD, 1 );
} }
MPI_Type_contiguous(2, MPI_INT, &derived_dtp);
MPI_Type_commit(&derived_dtp);
/* The following loop is used to run through a series of communicators /* The following loop is used to run through a series of communicators
* that are subsets of MPI_COMM_WORLD, of size 1 or greater. */ * that are subsets of MPI_COMM_WORLD, of size 1 or greater. */
while (MTestGetIntracommGeneral( &comm, 1, 1 )) { while (MTestGetIntracommGeneral( &comm, 1, 1 )) {
...@@ -137,7 +141,7 @@ int main( int argc, char *argv[] ) ...@@ -137,7 +141,7 @@ int main( int argc, char *argv[] )
MPI_Comm_rank( comm, &rank ); MPI_Comm_rank( comm, &rank );
MPI_Comm_size( comm, &size ); MPI_Comm_size( comm, &size );
MPI_Win_create( buf, bufsize, sizeof(int), MPI_INFO_NULL, comm, &win ); MPI_Win_create( buf, bufsize, 2*sizeof(int), MPI_INFO_NULL, comm, &win );
/* To improve reporting of problems about operations, we /* To improve reporting of problems about operations, we
change the error handler to errors return */ change the error handler to errors return */
MPI_Win_set_errhandler( win, MPI_ERRORS_RETURN ); MPI_Win_set_errhandler( win, MPI_ERRORS_RETURN );
...@@ -158,6 +162,10 @@ int main( int argc, char *argv[] ) ...@@ -158,6 +162,10 @@ int main( int argc, char *argv[] )
MPI_Accumulate( rmabuf, count, MPI_INT, TARGET, MPI_Accumulate( rmabuf, count, MPI_INT, TARGET,
0, count, MPI_INT, MPI_SUM, win ); 0, count, MPI_INT, MPI_SUM, win );
); );
TEST_FENCE_OP("Accumulate_derived",
MPI_Accumulate( rmabuf, count, derived_dtp, TARGET,
0, count, derived_dtp, MPI_SUM, win );
);
TEST_FENCE_OP("Get accumulate", TEST_FENCE_OP("Get accumulate",
MPI_Get_accumulate( rmabuf, count, MPI_INT, result, MPI_Get_accumulate( rmabuf, count, MPI_INT, result,
count, MPI_INT, TARGET, 0, count, MPI_INT, TARGET, 0,
...@@ -179,6 +187,10 @@ int main( int argc, char *argv[] ) ...@@ -179,6 +187,10 @@ int main( int argc, char *argv[] )
MPI_Accumulate( rmabuf, count, MPI_INT, TARGET, 0, MPI_Accumulate( rmabuf, count, MPI_INT, TARGET, 0,
count, MPI_INT, MPI_SUM, win ); count, MPI_INT, MPI_SUM, win );
); );
TEST_PT_OP("Accumulate_derived",
MPI_Accumulate( rmabuf, count, derived_dtp, TARGET, 0,
count, derived_dtp, MPI_SUM, win );
);
TEST_PT_OP("Get accumulate", TEST_PT_OP("Get accumulate",
MPI_Get_accumulate( rmabuf, count, MPI_INT, result, count, MPI_Get_accumulate( rmabuf, count, MPI_INT, result, count,
MPI_INT, TARGET, 0, count, MPI_INT, TARGET, 0, count,
...@@ -201,6 +213,10 @@ int main( int argc, char *argv[] ) ...@@ -201,6 +213,10 @@ int main( int argc, char *argv[] )
MPI_Raccumulate( rmabuf, count, MPI_INT, TARGET, 0, MPI_Raccumulate( rmabuf, count, MPI_INT, TARGET, 0,
count, MPI_INT, MPI_SUM, win, &req ); count, MPI_INT, MPI_SUM, win, &req );
); );
TEST_REQ_OP("Raccumulate_derived", req,
MPI_Raccumulate( rmabuf, count, derived_dtp, TARGET, 0,
count, derived_dtp, MPI_SUM, win, &req );
);
TEST_REQ_OP("Rget_accumulate", req, TEST_REQ_OP("Rget_accumulate", req,
MPI_Rget_accumulate( rmabuf, count, MPI_INT, result, MPI_Rget_accumulate( rmabuf, count, MPI_INT, result,
count, MPI_INT, TARGET, 0, count, MPI_INT, TARGET, 0,
...@@ -211,6 +227,8 @@ int main( int argc, char *argv[] ) ...@@ -211,6 +227,8 @@ int main( int argc, char *argv[] )
MTestFreeComm(&comm); MTestFreeComm(&comm);
} }
MPI_Type_free(&derived_dtp);
free( result ); free( result );
free( buf ); free( buf );
free( rmabuf ); free( rmabuf );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment