X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9b73466ada27682d1729f394549479da83ef4a99..0f9f94025e9ae3056958cc979e4f696b5ac698e0:/teshsuite/smpi/mpich3-test/datatype/tresized2.c diff --git a/teshsuite/smpi/mpich3-test/datatype/tresized2.c b/teshsuite/smpi/mpich3-test/datatype/tresized2.c index 064084bc40..7cbd3e33ee 100644 --- a/teshsuite/smpi/mpich3-test/datatype/tresized2.c +++ b/teshsuite/smpi/mpich3-test/datatype/tresized2.c @@ -13,68 +13,72 @@ static char MTEST_Descrip[] = "Test of type resized with non-zero LB"; */ -int main( int argc, char *argv[] ) +int main(int argc, char *argv[]) { int errs = 0, i; int rank, size, source, dest; - int count; - int *buf; - MPI_Comm comm; - MPI_Status status; - MPI_Datatype newtype; + int count; + int *buf; + MPI_Comm comm; + MPI_Status status; + MPI_Datatype newtype; - MTest_Init( &argc, &argv ); + MTest_Init(&argc, &argv); comm = MPI_COMM_WORLD; /* Determine the sender and receiver */ - MPI_Comm_rank( comm, &rank ); - MPI_Comm_size( comm, &size ); + MPI_Comm_rank(comm, &rank); + MPI_Comm_size(comm, &size); source = 0; - dest = size - 1; + dest = size - 1; /* Create an type that is "* INT * " - that is, there is a int-sized pad at the beginning of the type, - and the extent is still 3 ints. Note, however, that the INT - is still at displacement 0, so the effective pattern i*/ - MPI_Type_create_resized( MPI_INT, -(int)sizeof(int), 3 * sizeof(int), &newtype ); - MPI_Type_commit( &newtype ); + * that is, there is a int-sized pad at the beginning of the type, + * and the extent is still 3 ints. Note, however, that the INT + * is still at displacement 0, so the effective pattern i */ + MPI_Type_create_resized(MPI_INT, -(int) sizeof(int), 3 * sizeof(int), &newtype); + MPI_Type_commit(&newtype); for (count = 1; count < 65000; count = count * 2) { - buf = (int *)malloc( count * 3 * sizeof(int) ); - if (!buf) { - MPI_Abort( comm, 1 ); - } - for (i=0; i<3*count; i++) buf[i] = -1; - if (rank == source) { - for (i=0; i