X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9b73466ada27682d1729f394549479da83ef4a99..b1f5b9489d84e72cc1c4a0b51fe3940526de890c:/teshsuite/smpi/mpich3-test/datatype/struct-zero-count.c diff --git a/teshsuite/smpi/mpich3-test/datatype/struct-zero-count.c b/teshsuite/smpi/mpich3-test/datatype/struct-zero-count.c index 74b2d19dbf..0b7621920c 100644 --- a/teshsuite/smpi/mpich3-test/datatype/struct-zero-count.c +++ b/teshsuite/smpi/mpich3-test/datatype/struct-zero-count.c @@ -23,24 +23,25 @@ int main(int argc, char **argv) { int err, errs = 0; - MPI_Init(&argc, &argv); /* MPI-1.2 doesn't allow for MPI_Init(0,0) */ + MPI_Init(&argc, &argv); /* MPI-1.2 doesn't allow for MPI_Init(0,0) */ parse_args(argc, argv); /* To improve reporting of problems about operations, we - change the error handler to errors return */ - MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN ); + * change the error handler to errors return */ + MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN); /* perform some tests */ err = builtin_struct_test(); - if (err && verbose) fprintf(stderr, "%d errors in builtin struct test.\n", err); + if (err && verbose) + fprintf(stderr, "%d errors in builtin struct test.\n", err); errs += err; /* print message and exit */ if (errs) { - fprintf(stderr, "Found %d errors\n", errs); + fprintf(stderr, "Found %d errors\n", errs); } else { - printf(" No Errors\n"); + printf(" No Errors\n"); } MPI_Finalize(); return 0; @@ -62,54 +63,45 @@ int builtin_struct_test(void) int size; MPI_Aint extent; - err = MPI_Type_create_struct(count, - (int *) 0, - (MPI_Aint *) 0, - (MPI_Datatype *) 0, - &newtype); + err = MPI_Type_create_struct(count, (int *) 0, (MPI_Aint *) 0, (MPI_Datatype *) 0, &newtype); if (err != MPI_SUCCESS) { - if (verbose) { - fprintf(stderr, - "error creating struct type in builtin_struct_test()\n"); - } - errs++; + if (verbose) { + fprintf(stderr, "error creating struct type in builtin_struct_test()\n"); + } + errs++; } err = MPI_Type_size(newtype, &size); if (err != MPI_SUCCESS) { - if (verbose) { - fprintf(stderr, - "error obtaining type size in builtin_struct_test()\n"); - } - errs++; + if (verbose) { + fprintf(stderr, "error obtaining type size in builtin_struct_test()\n"); + } + errs++; } - + if (size != 0) { - if (verbose) { - fprintf(stderr, - "error: size != 0 in builtin_struct_test()\n"); - } - errs++; - } + if (verbose) { + fprintf(stderr, "error: size != 0 in builtin_struct_test()\n"); + } + errs++; + } err = MPI_Type_extent(newtype, &extent); if (err != MPI_SUCCESS) { - if (verbose) { - fprintf(stderr, - "error obtaining type extent in builtin_struct_test()\n"); - } - errs++; + if (verbose) { + fprintf(stderr, "error obtaining type extent in builtin_struct_test()\n"); + } + errs++; } - + if (extent != 0) { - if (verbose) { - fprintf(stderr, - "error: extent != 0 in builtin_struct_test()\n"); - } - errs++; - } + if (verbose) { + fprintf(stderr, "error: extent != 0 in builtin_struct_test()\n"); + } + errs++; + } - MPI_Type_free( &newtype ); + MPI_Type_free(&newtype); return errs; } @@ -118,19 +110,18 @@ int builtin_struct_test(void) int parse_args(int argc, char **argv) { /* - int ret; - - while ((ret = getopt(argc, argv, "v")) >= 0) - { - switch (ret) { - case 'v': - verbose = 1; - break; - } - } - */ + * int ret; + * + * while ((ret = getopt(argc, argv, "v")) >= 0) + * { + * switch (ret) { + * case 'v': + * verbose = 1; + * break; + * } + * } + */ if (argc > 1 && strcmp(argv[1], "-v") == 0) - verbose = 1; + verbose = 1; return 0; } -