1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
3 * (C) 2001 by Argonne National Laboratory.
4 * See COPYRIGHT in top-level directory.
7 /* Tests that commit of a couple of basic types succeeds. */
11 #include "mpitestconf.h"
16 static int verbose = 0;
18 int parse_args(int argc, char **argv);
20 int main(int argc, char **argv)
22 int mpi_err, errs = 0;
25 MPI_Init(&argc, &argv);
26 parse_args(argc, argv);
28 /* To improve reporting of problems about operations, we
29 change the error handler to errors return */
30 MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
33 mpi_err = MPI_Type_commit(&type);
34 if (mpi_err != MPI_SUCCESS) {
36 fprintf(stderr, "MPI_Type_commit of MPI_INT failed.\n");
42 mpi_err = MPI_Type_commit(&type);
43 if (mpi_err != MPI_SUCCESS) {
45 fprintf(stderr, "MPI_Type_commit of MPI_FLOAT_INT failed.\n");
50 /* print message and exit */
52 fprintf(stderr, "Found %d errors\n", errs);
55 printf(" No Errors\n");
61 int parse_args(int argc, char **argv)
66 while ((ret = getopt(argc, argv, "v")) >= 0)
75 if (argc > 1 && strcmp(argv[1], "-v") == 0)