1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
/*
* Copyright (C) by Argonne National Laboratory
* See COPYRIGHT in top-level directory
*/
#include <mpi.h>
#include <stdio.h>
/* FIXME: This behavior of this test is implementation specific. */
static int verbose = 0;
int main(int argc, char **argv)
{
int MY_ERROR_CLASS;
int MY_ERROR_CODE;
char MY_ERROR_STRING[10];
sprintf(MY_ERROR_STRING, "MY ERROR");
MPI_Init(&argc, &argv);
if (verbose)
printf("Adding My Error Class\n");
MPI_Add_error_class(&MY_ERROR_CLASS);
if (verbose)
printf("Adding My Error Code\n");
MPI_Add_error_code(MY_ERROR_CLASS, &MY_ERROR_CODE);
if (verbose)
printf("Adding My Error String\n");
MPI_Add_error_string(MY_ERROR_CODE, MY_ERROR_STRING);
if (verbose)
printf("Calling Error Handler\n");
MPI_Comm_call_errhandler(MPI_COMM_WORLD, MY_ERROR_CODE);
/* We should not get here, because the default error handler
* is ERRORS_ARE_FATAL. This makes sure that the correct error
* handler is called and that no failure occurred (such as
* a SEGV) in Comm_call_errhandler on the default
* error handler. */
printf("After the Error Handler Has Been Called\n");
MPI_Finalize();
return 0;
}
|