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 */
36 fprintf(stderr, "%d errors in contig test.\n", err);
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, MPI_INT, &newtype);
67 if (err != MPI_SUCCESS) {
69 fprintf(stderr, "error creating type in contig_test()\n");
74 err = MPI_Type_size(newtype, &size);
75 if (err != MPI_SUCCESS) {
77 fprintf(stderr, "error obtaining type size in contig_test()\n");
84 fprintf(stderr, "error: size != 0 in contig_test()\n");
89 err = MPI_Type_extent(newtype, &extent);
90 if (err != MPI_SUCCESS) {
92 fprintf(stderr, "error obtaining type extent in contig_test()\n");
99 fprintf(stderr, "error: extent != 0 in contig_test()\n");
104 MPI_Type_free(&newtype);
110 int parse_args(int argc, char **argv)
115 * while ((ret = getopt(argc, argv, "v")) >= 0)
124 if (argc > 1 && strcmp(argv[1], "-v") == 0)