X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0e9c0448c6566825b170b98ecff716b098bda10e..90f50bba185f1c86225aa498dcc3a01c9080b52b:/teshsuite/smpi/mpich3-test/coll/scatter3.c diff --git a/teshsuite/smpi/mpich3-test/coll/scatter3.c b/teshsuite/smpi/mpich3-test/coll/scatter3.c index a95748d3ed..84e88bbcf4 100644 --- a/teshsuite/smpi/mpich3-test/coll/scatter3.c +++ b/teshsuite/smpi/mpich3-test/coll/scatter3.c @@ -13,75 +13,76 @@ /* This example sends contiguous data and receives a vector on some nodes and contiguous data on others. There is some evidence that some MPI implementations do not check recvcount on the root process; this - test checks for that case + test checks for that case */ -int main( int argc, char **argv ) +int main(int argc, char **argv) { MPI_Datatype vec; double *vecin, *vecout, ivalue; - int root, i, n, stride, errs = 0; - int rank, size; + int root, i, n, stride, errs = 0; + int rank, size; MPI_Aint vextent; - MTest_Init( &argc, &argv ); - - MPI_Comm_size( MPI_COMM_WORLD, &size ); - MPI_Comm_rank( MPI_COMM_WORLD, &rank ); + MTest_Init(&argc, &argv); + + MPI_Comm_size(MPI_COMM_WORLD, &size); + MPI_Comm_rank(MPI_COMM_WORLD, &rank); n = 12; stride = 10; /* Note that vecout really needs to be only (n-1)*stride+1 doubles, but - this is easier and allows a little extra room if there is a bug */ - vecout = (double *)malloc( n * stride * sizeof(double) ); - vecin = (double *)malloc( n * size * sizeof(double) ); - - MPI_Type_vector( n, 1, stride, MPI_DOUBLE, &vec ); - MPI_Type_commit( &vec ); - MPI_Type_extent( vec, &vextent ); - if (vextent != ((n-1)*(MPI_Aint)stride + 1) * sizeof(double) ) { - errs++; - printf( "Vector extent is %ld, should be %ld\n", - (long) vextent, (long)(((n-1)*stride+1)*sizeof(double)) ); + * this is easier and allows a little extra room if there is a bug */ + vecout = (double *) malloc(n * stride * sizeof(double)); + vecin = (double *) malloc(n * size * sizeof(double)); + + MPI_Type_vector(n, 1, stride, MPI_DOUBLE, &vec); + MPI_Type_commit(&vec); + MPI_Type_extent(vec, &vextent); + if (vextent != ((n - 1) * (MPI_Aint) stride + 1) * sizeof(double)) { + errs++; + printf("Vector extent is %ld, should be %ld\n", + (long) vextent, (long) (((n - 1) * stride + 1) * sizeof(double))); } /* Note that the exted of type vector is from the first to the - last element, not n*stride. - E.g., with n=1, the extent is a single double */ + * last element, not n*stride. + * E.g., with n=1, the extent is a single double */ - for (i=0; i