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-08-12 05:14:45 +04:00
|
|
|
#include "errhandler/errcode.h"
|
2004-06-18 19:47:17 +04:00
|
|
|
#include "communicator/communicator.h"
|
2004-09-06 16:06:27 +04:00
|
|
|
#include "file/file.h"
|
|
|
|
#include "win/win.h"
|
2004-06-18 19:47:17 +04:00
|
|
|
#include "runtime/runtime.h"
|
2004-03-19 09:12:43 +03:00
|
|
|
|
|
|
|
|
2004-09-06 16:06:27 +04:00
|
|
|
void ompi_mpi_errors_are_fatal_comm_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-09-16 00:54:11 +04:00
|
|
|
fflush(stdout);
|
|
|
|
fflush(stderr);
|
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) {
|
2004-08-12 05:14:45 +04:00
|
|
|
char *tmp = ompi_mpi_errcode_get_string(*error_code);
|
|
|
|
if (NULL != tmp) {
|
|
|
|
ompi_output(0, "*** %s\n", tmp);
|
|
|
|
} else {
|
|
|
|
ompi_output(0, "*** Error code: %d (no associated error message)\n",
|
|
|
|
*error_code);
|
|
|
|
}
|
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-09-06 16:06:27 +04:00
|
|
|
void ompi_mpi_errors_are_fatal_file_handler(struct ompi_file_t **file,
|
|
|
|
int *error_code, ...)
|
|
|
|
{
|
|
|
|
char *arg;
|
|
|
|
va_list arglist;
|
|
|
|
|
|
|
|
#if __STDC__
|
|
|
|
va_start(arglist, error_code);
|
|
|
|
#else
|
|
|
|
va_start(arglist);
|
|
|
|
#endif
|
|
|
|
|
2004-09-16 00:54:11 +04:00
|
|
|
fflush(stdout);
|
|
|
|
fflush(stderr);
|
2004-09-06 16:06:27 +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 != file && ompi_mpi_initialized && !ompi_mpi_finalized) {
|
|
|
|
ompi_output(0, "*** on file %s", (*file)->f_filename);
|
|
|
|
} 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 == file) {
|
|
|
|
ompi_output(0, "*** on a NULL file");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (NULL != error_code) {
|
|
|
|
char *tmp = ompi_mpi_errcode_get_string(*error_code);
|
|
|
|
if (NULL != tmp) {
|
|
|
|
ompi_output(0, "*** %s\n", tmp);
|
|
|
|
} else {
|
|
|
|
ompi_output(0, "*** Error code: %d (no associated error message)\n",
|
|
|
|
*error_code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ompi_output(0, "*** MPI_ERRORS_ARE_FATAL (goodbye)");
|
|
|
|
va_end(arglist);
|
|
|
|
|
|
|
|
/* Should we do something more intelligent here? */
|
|
|
|
|
|
|
|
abort();
|
|
|
|
}
|
|
|
|
|
|
|
|
void ompi_mpi_errors_are_fatal_win_handler(struct ompi_win_t **win,
|
|
|
|
int *error_code, ...)
|
|
|
|
{
|
|
|
|
char *arg;
|
|
|
|
va_list arglist;
|
|
|
|
|
|
|
|
#if __STDC__
|
|
|
|
va_start(arglist, error_code);
|
|
|
|
#else
|
|
|
|
va_start(arglist);
|
|
|
|
#endif
|
|
|
|
|
2004-09-16 00:54:11 +04:00
|
|
|
fflush(stdout);
|
|
|
|
fflush(stderr);
|
2004-09-06 16:06:27 +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 != win && ompi_mpi_initialized && !ompi_mpi_finalized) {
|
|
|
|
ompi_output(0, "*** on win %s", (*win)->w_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 == win) {
|
|
|
|
ompi_output(0, "*** on a NULL window");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (NULL != error_code) {
|
|
|
|
char *tmp = ompi_mpi_errcode_get_string(*error_code);
|
|
|
|
if (NULL != tmp) {
|
|
|
|
ompi_output(0, "*** %s\n", tmp);
|
|
|
|
} else {
|
|
|
|
ompi_output(0, "*** Error code: %d (no associated error message)\n",
|
|
|
|
*error_code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ompi_output(0, "*** MPI_ERRORS_ARE_FATAL (goodbye)");
|
|
|
|
va_end(arglist);
|
|
|
|
|
|
|
|
/* Should we do something more intelligent here? */
|
|
|
|
|
|
|
|
abort();
|
|
|
|
}
|
|
|
|
|
|
|
|
void ompi_mpi_errors_return_comm_handler(struct ompi_communicator_t **comm,
|
|
|
|
int *error_code, ...)
|
|
|
|
{
|
|
|
|
/* Don't need anything more -- just need this function to exist */
|
|
|
|
}
|
|
|
|
|
|
|
|
void ompi_mpi_errors_return_file_handler(struct ompi_file_t **file,
|
|
|
|
int *error_code, ...)
|
|
|
|
{
|
|
|
|
/* Don't need anything more -- just need this function to exist */
|
|
|
|
}
|
|
|
|
|
|
|
|
void ompi_mpi_errors_return_win_handler(struct ompi_win_t **win,
|
|
|
|
int *error_code, ...)
|
2004-03-19 09:12:43 +03:00
|
|
|
{
|
|
|
|
/* Don't need anything more -- just need this function to exist */
|
|
|
|
}
|