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.
9 #include "mpitestconf.h"
14 static int verbose = 0;
17 int contig_test(void);
19 /* helper functions */
20 int parse_args(int argc, char **argv);
22 int main(int argc, char **argv)
26 MPI_Init(&argc, &argv); /* MPI-1.2 doesn't allow for MPI_Init(0,0) */
27 parse_args(argc, argv);
29 /* To improve reporting of problems about operations, we
30 change the error handler to errors return */
31 MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
33 /* perform some tests */
35 if (err && verbose) fprintf(stderr, "%d errors in contig test.\n",
39 /* print message and exit */
41 fprintf(stderr, "Found %d errors\n", errs);
44 printf(" No Errors\n");
52 * Tests behavior with a zero-count contig.
54 * Returns the number of errors encountered.
66 err = MPI_Type_contiguous(count,
69 if (err != MPI_SUCCESS) {
72 "error creating type in contig_test()\n");
77 err = MPI_Type_size(newtype, &size);
78 if (err != MPI_SUCCESS) {
81 "error obtaining type size in contig_test()\n");
89 "error: size != 0 in contig_test()\n");
94 err = MPI_Type_extent(newtype, &extent);
95 if (err != MPI_SUCCESS) {
98 "error obtaining type extent in contig_test()\n");
106 "error: extent != 0 in contig_test()\n");
111 MPI_Type_free( &newtype );
117 int parse_args(int argc, char **argv)
122 while ((ret = getopt(argc, argv, "v")) >= 0)
131 if (argc > 1 && strcmp(argv[1], "-v") == 0)