X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d9c9e08948a8387e9e8ecb0fe67ab6b94ec2a66f..90f50bba185f1c86225aa498dcc3a01c9080b52b:/teshsuite/smpi/mpich3-test/coll/alltoall1.c diff --git a/teshsuite/smpi/mpich3-test/coll/alltoall1.c b/teshsuite/smpi/mpich3-test/coll/alltoall1.c index 6974627617..41739af6f5 100644 --- a/teshsuite/smpi/mpich3-test/coll/alltoall1.c +++ b/teshsuite/smpi/mpich3-test/coll/alltoall1.c @@ -8,101 +8,102 @@ #include #include "mpitest.h" #include +#include "mpicolltest.h" /* static char MTEST_Descrip[] = ""; */ -int main( int argc, char *argv[] ) +int main(int argc, char *argv[]) { int errs = 0; int rank, size; - int minsize = 2, count; - MPI_Comm comm; + int minsize = 2, count; + MPI_Comm comm; int *sendbuf, *recvbuf, *p; int sendcount, recvcount; int i, j; MPI_Datatype sendtype, recvtype; - MTest_Init( &argc, &argv ); + MTest_Init(&argc, &argv); - /* The following illustrates the use of the routines to - run through a selection of communicators and datatypes. - Use subsets of these for tests that do not involve combinations - of communicators, datatypes, and counts of datatypes */ - while (MTestGetIntracommGeneral( &comm, minsize, 1 )) { - if (comm == MPI_COMM_NULL) continue; + /* The following illustrates the use of the routines to + * run through a selection of communicators and datatypes. + * Use subsets of these for tests that do not involve combinations + * of communicators, datatypes, and counts of datatypes */ + while (MTestGetIntracommGeneral(&comm, minsize, 1)) { + if (comm == MPI_COMM_NULL) + continue; - /* Determine the sender and receiver */ - MPI_Comm_rank( comm, &rank ); - MPI_Comm_size( comm, &size ); - - /* printf( "Size of comm = %d\n", size ); */ - for (count = 1; count < 65000; count = count * 2) { - - /* Create a send buf and a receive buf suitable for testing - all to all. */ - sendcount = count; - recvcount = count; - sendbuf = (int *)malloc( count * size * sizeof(int) ); - recvbuf = (int *)malloc( count * size * sizeof(int) ); - sendtype = MPI_INT; - recvtype = MPI_INT; + /* Determine the sender and receiver */ + MPI_Comm_rank(comm, &rank); + MPI_Comm_size(comm, &size); - if (!sendbuf || !recvbuf) { - errs++; - fprintf( stderr, "Failed to allocate sendbuf and/or recvbuf\n" ); - MPI_Abort( MPI_COMM_WORLD, 1 ); - exit(1); - } - for (i=0; i