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 int main(int argc, char *argv[]);
15 int parse_args(int argc, char **argv);
17 int main(int argc, char *argv[])
19 int i, err, errs = 0, rank, toterrs;
22 MPI_Request requests[10];
23 MPI_Status statuses[10];
25 MPI_Init(&argc, &argv);
26 parse_args(argc, argv);
28 for (i = 0; i < 10; i++) {
29 requests[i] = MPI_REQUEST_NULL;
33 /* To improve reporting of problems about operations, we
34 * change the error handler to errors return */
35 MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
37 err = MPI_Waitany(10, requests, &index, statuses);
39 if (err != MPI_SUCCESS) {
41 fprintf(stderr, "MPI_Waitany did not return MPI_SUCCESS\n");
44 if (index != MPI_UNDEFINED) {
46 fprintf(stderr, "MPI_Waitany did not set index to MPI_UNDEFINED\n");
51 MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL);
52 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
53 MPI_Allreduce(&errs, &toterrs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
56 fprintf(stderr, " Found %d errors\n", toterrs);
59 printf(" No Errors\n");
66 int parse_args(int argc, char **argv)
71 * while ((ret = getopt(argc, argv, "v")) >= 0)
75 * verbose = 1; <-- never used, thus removed