2004-03-19 09:12:43 +03:00
|
|
|
/*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#if __STDC__
|
|
|
|
#include <stdarg.h>
|
|
|
|
#else
|
|
|
|
#include <varargs.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "util/output.h"
|
|
|
|
#include "errhandler/errhandler.h"
|
|
|
|
#include "errhandler/errhandler_predefined.h"
|
2004-06-18 19:47:17 +04:00
|
|
|
#include "communicator/communicator.h"
|
|
|
|
#include "runtime/runtime.h"
|
2004-03-19 09:12:43 +03:00
|
|
|
|
|
|
|
|
2004-06-18 19:47:17 +04:00
|
|
|
void ompi_mpi_errors_are_fatal_handler(struct ompi_communicator_t **comm,
|
|
|
|
int *error_code, ...)
|
2004-03-19 09:12:43 +03:00
|
|
|
{
|
2004-06-23 00:21:35 +04:00
|
|
|
char *arg;
|
2004-03-19 09:12:43 +03:00
|
|
|
va_list arglist;
|
2004-06-23 00:21:35 +04:00
|
|
|
|
2004-03-19 09:12:43 +03:00
|
|
|
#if __STDC__
|
|
|
|
va_start(arglist, error_code);
|
|
|
|
#else
|
|
|
|
va_start(arglist);
|
|
|
|
#endif
|
2004-06-18 19:47:17 +04:00
|
|
|
|
2004-06-23 00:21:35 +04:00
|
|
|
arg = va_arg(arglist, char*);
|
|
|
|
if (NULL != arg) {
|
|
|
|
ompi_output(0, "*** An error occurred in %s", arg);
|
|
|
|
} else {
|
|
|
|
ompi_output(0, "*** An error occurred");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (NULL != comm && ompi_mpi_initialized && !ompi_mpi_finalized) {
|
2004-06-18 19:47:17 +04:00
|
|
|
ompi_output(0, "*** on communicator %s", (*comm)->c_name);
|
|
|
|
} else if (!ompi_mpi_initialized) {
|
|
|
|
ompi_output(0, "*** before MPI was initialized");
|
|
|
|
} else if (ompi_mpi_finalized) {
|
|
|
|
ompi_output(0, "*** after MPI was finalized");
|
|
|
|
} else if (NULL == comm) {
|
|
|
|
ompi_output(0, "*** on a NULL communicator");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (NULL != error_code) {
|
|
|
|
ompi_output(0, "*** error code: %d\n", *error_code);
|
|
|
|
}
|
2004-03-19 09:12:43 +03:00
|
|
|
/* JMS: Should print the error string as well */
|
2004-06-18 19:47:17 +04:00
|
|
|
ompi_output(0, "*** MPI_ERRORS_ARE_FATAL (goodbye)");
|
2004-03-19 09:12:43 +03:00
|
|
|
va_end(arglist);
|
|
|
|
|
|
|
|
/* Should we do something more intelligent here? */
|
|
|
|
|
|
|
|
abort();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-06-18 19:47:17 +04:00
|
|
|
void ompi_mpi_errors_return_handler(struct ompi_communicator_t **comm,
|
2004-03-19 09:12:43 +03:00
|
|
|
int *error_code, ...)
|
|
|
|
{
|
|
|
|
/* Don't need anything more -- just need this function to exist */
|
|
|
|
}
|