X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d0ffc37686edcc803601f76ab51fdfed5fc2f241..19b3962253112b19308537bc2400de141c119d99:/teshsuite/smpi/mpich3-test/datatype/typelb.c diff --git a/teshsuite/smpi/mpich3-test/datatype/typelb.c b/teshsuite/smpi/mpich3-test/datatype/typelb.c index 2dedadbca9..6698e64563 100644 --- a/teshsuite/smpi/mpich3-test/datatype/typelb.c +++ b/teshsuite/smpi/mpich3-test/datatype/typelb.c @@ -7,7 +7,7 @@ #include "mpi.h" #include -int main( int argc, char **argv) +int main(int argc, char **argv) { int blockcnt[2], rank; MPI_Aint offsets[2], lb, ub, extent; @@ -19,34 +19,35 @@ int main( int argc, char **argv) blockcnt[1] = -1; offsets[1] = -1; - MPI_Comm_rank( MPI_COMM_WORLD, &rank ); + MPI_Comm_rank(MPI_COMM_WORLD, &rank); if (rank == 0) { - blockcnt[0] = 1; - offsets[0] = 3; - MPI_Type_hindexed(1, blockcnt, offsets, MPI_BYTE, &tmp_type); - blockcnt[0] = 1; - offsets[0] = 1; - MPI_Type_hindexed(1, blockcnt, offsets, tmp_type, &newtype); - MPI_Type_commit(&newtype); - - MPI_Type_lb(newtype, &lb); - MPI_Type_extent(newtype, &extent); - MPI_Type_ub(newtype, &ub); - - /* Check that the results are correct */ + blockcnt[0] = 1; + offsets[0] = 3; + MPI_Type_hindexed(1, blockcnt, offsets, MPI_BYTE, &tmp_type); + blockcnt[0] = 1; + offsets[0] = 1; + MPI_Type_hindexed(1, blockcnt, offsets, tmp_type, &newtype); + MPI_Type_commit(&newtype); + + MPI_Type_lb(newtype, &lb); + MPI_Type_extent(newtype, &extent); + MPI_Type_ub(newtype, &ub); + + /* Check that the results are correct */ #ifdef DEBUG - printf("lb=%ld, ub=%ld, extent=%ld\n", lb, ub, extent); - printf("Should be lb=4, ub=5, extent=1\n"); + printf("lb=%ld, ub=%ld, extent=%ld\n", lb, ub, extent); + printf("Should be lb=4, ub=5, extent=1\n"); #endif - if (lb != 4 || ub != 5 || extent != 1) { - printf ("lb = %d (should be 4), ub = %d (should be 5) extent = %d should be 1\n", (int)lb, (int)ub, (int)extent) ; - } - else { - printf( " No Errors\n" ); - } - - MPI_Type_free(&tmp_type); - MPI_Type_free(&newtype); + if (lb != 4 || ub != 5 || extent != 1) { + printf("lb = %d (should be 4), ub = %d (should be 5) extent = %d should be 1\n", + (int) lb, (int) ub, (int) extent); + } + else { + printf(" No Errors\n"); + } + + MPI_Type_free(&tmp_type); + MPI_Type_free(&newtype); } MPI_Finalize();