X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/281f8c29e177852dcb1591fc31e363e1176857c8..90f50bba185f1c86225aa498dcc3a01c9080b52b:/teshsuite/smpi/mpich3-test/coll/icalltoallv.c diff --git a/teshsuite/smpi/mpich3-test/coll/icalltoallv.c b/teshsuite/smpi/mpich3-test/coll/icalltoallv.c index 223392366a..90cf06a79b 100644 --- a/teshsuite/smpi/mpich3-test/coll/icalltoallv.c +++ b/teshsuite/smpi/mpich3-test/coll/icalltoallv.c @@ -7,6 +7,7 @@ #include "mpitest.h" #include #include +#include "mpicolltest.h" /* This program tests MPI_Alltoallv by having processor i send different @@ -14,88 +15,87 @@ Because there are separate send and receive types to alltoallv, there need to be tests to rearrange data on the fly. Not done yet. - + The first test sends i items to processor i from all processors. Currently, the test uses only MPI_INT; this is adequate for testing systems that use point-to-point operations */ -int main( int argc, char **argv ) +int main(int argc, char **argv) { MPI_Comm comm; - int *sbuf, *rbuf; - int rank, size, lsize, asize; - int *sendcounts, *recvcounts, *rdispls, *sdispls; - int i, j, *p, err; - int leftGroup; + int *sbuf, *rbuf; + int rank, size, lsize, asize; + int *sendcounts, *recvcounts, *rdispls, *sdispls; + int i, j, *p, err; + int leftGroup; - MTest_Init( &argc, &argv ); + MTest_Init(&argc, &argv); err = 0; - while (MTestGetIntercomm( &comm, &leftGroup, 4 )) { - if (comm == MPI_COMM_NULL) continue; + while (MTestGetIntercomm(&comm, &leftGroup, 4)) { + if (comm == MPI_COMM_NULL) + continue; - /* Create the buffer */ - MPI_Comm_size( comm, &lsize ); - MPI_Comm_remote_size( comm, &size ); - asize = (lsize > size) ? lsize : size; - MPI_Comm_rank( comm, &rank ); - sbuf = (int *)malloc( size * size * sizeof(int) ); - rbuf = (int *)malloc( asize * asize * sizeof(int) ); - if (!sbuf || !rbuf) { - fprintf( stderr, "Could not allocated buffers!\n" ); - MPI_Abort( comm, 1 ); - exit(1); - } + /* Create the buffer */ + MPI_Comm_size(comm, &lsize); + MPI_Comm_remote_size(comm, &size); + asize = (lsize > size) ? lsize : size; + MPI_Comm_rank(comm, &rank); + sbuf = (int *) malloc(size * size * sizeof(int)); + rbuf = (int *) malloc(asize * asize * sizeof(int)); + if (!sbuf || !rbuf) { + fprintf(stderr, "Could not allocated buffers!\n"); + MPI_Abort(comm, 1); + } - /* Load up the buffers */ - for (i=0; i