X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/50130868c2f0c10d86bf368ede7154f6845b0d51..558e19f535bb0c65b610bc758c8133ded549ca3c:/teshsuite/smpi/mpich3-test/datatype/tfree.c diff --git a/teshsuite/smpi/mpich3-test/datatype/tfree.c b/teshsuite/smpi/mpich3-test/datatype/tfree.c index 9f909f28a9..0d829d9a60 100644 --- a/teshsuite/smpi/mpich3-test/datatype/tfree.c +++ b/teshsuite/smpi/mpich3-test/datatype/tfree.c @@ -16,91 +16,89 @@ static char MTEST_Descrip[] = "Test that freed datatypes have reference count se #define VEC_NELM 128 #define VEC_STRIDE 8 -int main( int argc, char *argv[] ) +int main(int argc, char *argv[]) { int errs = 0; int rank, size, source, dest, i; - MPI_Comm comm; - MPI_Status status; - MPI_Request req; - MPI_Datatype strideType; - MPI_Datatype tmpType[1024]; - int *buf = 0; + MPI_Comm comm; + MPI_Status status; + MPI_Request req; + MPI_Datatype strideType; + MPI_Datatype tmpType[1024]; + int *buf = 0; - MTest_Init( &argc, &argv ); + MTest_Init(&argc, &argv); comm = MPI_COMM_WORLD; - MPI_Comm_rank( comm, &rank ); - MPI_Comm_size( comm, &size ); + MPI_Comm_rank(comm, &rank); + MPI_Comm_size(comm, &size); if (size < 2) { - fprintf( stderr, "This test requires at least two processes." ); - MPI_Abort( MPI_COMM_WORLD, 1 ); - exit(1); + fprintf(stderr, "This test requires at least two processes."); + MPI_Abort(MPI_COMM_WORLD, 1); } - source = 0; - dest = size - 1; - - /* - The idea here is to create a simple but non-contig datatype, - perform an irecv with it, free it, and then create - many new datatypes. While not a complete test, if the datatype - was freed and the space was reused, this test may detect - that error - A similar test for sends might work by sending a large enough message - to force the use of rendezvous send. - */ - MPI_Type_vector( VEC_NELM, 1, VEC_STRIDE, MPI_INT, &strideType ); - MPI_Type_commit( &strideType ); + source = 0; + dest = size - 1; + + /* + * The idea here is to create a simple but non-contig datatype, + * perform an irecv with it, free it, and then create + * many new datatypes. While not a complete test, if the datatype + * was freed and the space was reused, this test may detect + * that error + * A similar test for sends might work by sending a large enough message + * to force the use of rendezvous send. + */ + MPI_Type_vector(VEC_NELM, 1, VEC_STRIDE, MPI_INT, &strideType); + MPI_Type_commit(&strideType); if (rank == dest) { - buf = (int *)malloc( VEC_NELM * VEC_STRIDE * sizeof(int) ); - for (i=0; i