X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/281f8c29e177852dcb1591fc31e363e1176857c8..90f50bba185f1c86225aa498dcc3a01c9080b52b:/teshsuite/smpi/mpich3-test/coll/alltoallv0.c diff --git a/teshsuite/smpi/mpich3-test/coll/alltoallv0.c b/teshsuite/smpi/mpich3-test/coll/alltoallv0.c index 5890043dd7..a771c76493 100644 --- a/teshsuite/smpi/mpich3-test/coll/alltoallv0.c +++ b/teshsuite/smpi/mpich3-test/coll/alltoallv0.c @@ -9,126 +9,126 @@ #include /* - This program tests MPI_Alltoallv by having processor each process + This program tests MPI_Alltoallv by having processor each process send data to two neighbors only, using counts of 0 for the other processes. This idiom is sometimes used for halo exchange operations. Because there are separate send and receive types to alltoallv, there need to be tests to rearrange data on the fly. Not done yet. - + 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; - int *sendcounts, *recvcounts, *rdispls, *sdispls; - int i, *p, err; - int left, right, length; - - MTest_Init( &argc, &argv ); + int *sbuf, *rbuf; + int rank, size; + int *sendcounts, *recvcounts, *rdispls, *sdispls; + int i, *p, err; + int left, right, length; + + MTest_Init(&argc, &argv); err = 0; - - while (MTestGetIntracommGeneral( &comm, 2, 1 )) { - if (comm == MPI_COMM_NULL) continue; - - MPI_Comm_size( comm, &size ); - MPI_Comm_rank( comm, &rank ); - - if (size < 3) continue; - - /* Create and load the arguments to alltoallv */ - sendcounts = (int *)malloc( size * sizeof(int) ); - recvcounts = (int *)malloc( size * sizeof(int) ); - rdispls = (int *)malloc( size * sizeof(int) ); - sdispls = (int *)malloc( size * sizeof(int) ); - if (!sendcounts || !recvcounts || !rdispls || !sdispls) { - fprintf( stderr, "Could not allocate arg items!\n" ); - MPI_Abort( comm, 1 ); - exit(1); - } - - /* Get the neighbors */ - left = (rank - 1 + size) % size; - right = (rank + 1) % size; - - /* Set the defaults */ - for (i=0; i