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.
8 #include "mpitestconf.h"
14 static int verbose = 0;
16 int parse_args(int argc, char **argv);
18 int main(int argc, char *argv[])
20 int i, err, errs = 0, rank, toterrs;
23 MPI_Request requests[10];
24 MPI_Status statuses[10];
26 MPI_Init(&argc, &argv);
27 parse_args(argc, argv);
29 for (i=0; i < 10; i++) {
30 requests[i] = MPI_REQUEST_NULL;
34 /* To improve reporting of problems about operations, we
35 change the error handler to errors return */
36 MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
38 err = MPI_Waitany(10, requests, &index, statuses);
40 if (err != MPI_SUCCESS) {
42 fprintf(stderr, "MPI_Waitany did not return MPI_SUCCESS\n");
45 if (index != MPI_UNDEFINED) {
47 fprintf(stderr, "MPI_Waitany did not set index to MPI_UNDEFINED\n");
52 MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL );
53 MPI_Comm_rank( MPI_COMM_WORLD, & rank );
54 MPI_Allreduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
57 fprintf(stderr, " Found %d errors\n", toterrs);
60 printf(" No Errors\n");
67 int parse_args(int argc, char **argv)
72 while ((ret = getopt(argc, argv, "v")) >= 0)
81 if (argc > 1 && strcmp(argv[1], "-v") == 0)