fixing a problem for error handlers as discussed with Jeff a couple of weeks ago. The macros used in the MPI functions have not changed, thus the modifications should be transparent to all other functions.
This commit was SVN r2522.
Этот коммит содержится в:
родитель
2169e1a043
Коммит
718be11bdb
@ -244,6 +244,7 @@ static void ompi_comm_construct(ompi_communicator_t* comm)
|
||||
comm->c_coll_basic_module = NULL;
|
||||
comm->c_coll_basic_data = NULL;
|
||||
|
||||
comm->errhandler_type = OMPI_ERRHANDLER_TYPE_COMM;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,8 @@ struct ompi_communicator_t {
|
||||
that the OMPI_ERRHDL_* macros can find it, regardless of whether
|
||||
it's a comm, window, or file. */
|
||||
|
||||
ompi_errhandler_t *error_handler;
|
||||
ompi_errhandler_t *error_handler;
|
||||
ompi_errhandler_type_t errhandler_type;
|
||||
|
||||
/* Hooks for PML to hang things */
|
||||
|
||||
|
@ -39,7 +39,7 @@ static inline int ompi_errcode_get_mpi_code(int errcode)
|
||||
ompi_errcode_intern_t *__errc;
|
||||
|
||||
for ( __i=0; __i<ompi_errcode_intern_lastused; __i++) {
|
||||
__errc = ompi_pointer_array_get_item(&ompi_errcodes_intern, __i);
|
||||
__errc = (ompi_errcode_intern_t *)ompi_pointer_array_get_item(&ompi_errcodes_intern, __i);
|
||||
if ( __errc->code == errcode ) {
|
||||
__ret = __errc->mpi_code;
|
||||
break;
|
||||
|
@ -39,11 +39,16 @@ ompi_errhandler_t ompi_mpi_errhandler_null = {
|
||||
{ NULL, 0 },
|
||||
|
||||
"MPI_ERRHANDLER_NULL",
|
||||
OMPI_ERRHANDLER_TYPE_COMM,
|
||||
true,
|
||||
OMPI_ERRHANDLER_TYPE_PREDEFINED,
|
||||
false,
|
||||
{ NULL }
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
-1
|
||||
};
|
||||
void ompi_mpi_errors_return_handler(struct ompi_communicator_t **comm,
|
||||
int *error_code, ...);
|
||||
|
||||
|
||||
/*
|
||||
@ -53,10 +58,12 @@ ompi_errhandler_t ompi_mpi_errors_are_fatal = {
|
||||
{ NULL, 0 },
|
||||
|
||||
"MPI_ERRORS_ARE_FATAL",
|
||||
OMPI_ERRHANDLER_TYPE_COMM,
|
||||
true,
|
||||
OMPI_ERRHANDLER_TYPE_PREDEFINED,
|
||||
false,
|
||||
{ ompi_mpi_errors_are_fatal_handler },
|
||||
ompi_mpi_errors_are_fatal_comm_handler,
|
||||
ompi_mpi_errors_are_fatal_file_handler,
|
||||
ompi_mpi_errors_are_fatal_win_handler,
|
||||
NULL,
|
||||
-1
|
||||
};
|
||||
|
||||
@ -68,10 +75,12 @@ ompi_errhandler_t ompi_mpi_errors_return = {
|
||||
{ NULL, 0 },
|
||||
|
||||
"MPI_ERRORS_RETURN",
|
||||
OMPI_ERRHANDLER_TYPE_COMM,
|
||||
true,
|
||||
OMPI_ERRHANDLER_TYPE_PREDEFINED,
|
||||
false,
|
||||
{ ompi_mpi_errors_return_handler },
|
||||
ompi_mpi_errors_return_comm_handler,
|
||||
ompi_mpi_errors_return_file_handler,
|
||||
ompi_mpi_errors_return_win_handler,
|
||||
NULL,
|
||||
-1
|
||||
};
|
||||
|
||||
@ -123,7 +132,7 @@ int ompi_errhandler_finalize(void)
|
||||
|
||||
|
||||
ompi_errhandler_t *ompi_errhandler_create(ompi_errhandler_type_t object_type,
|
||||
ompi_errhandler_fortran_handler_fn_t *func)
|
||||
ompi_errhandler_generic_handler_fn_t *func)
|
||||
{
|
||||
ompi_errhandler_t *new_errhandler;
|
||||
|
||||
@ -145,9 +154,22 @@ ompi_errhandler_t *ompi_errhandler_create(ompi_errhandler_type_t object_type,
|
||||
type when we *use* it). */
|
||||
|
||||
new_errhandler->eh_mpi_object_type = object_type;
|
||||
new_errhandler->eh_is_intrinsic = false;
|
||||
new_errhandler->eh_fortran_function = false;
|
||||
new_errhandler->eh_func.fort_fn = func;
|
||||
switch (object_type ) {
|
||||
case (OMPI_ERRHANDLER_TYPE_COMM):
|
||||
new_errhandler->eh_comm_fn = (MPI_Comm_errhandler_fn *)func;
|
||||
break;
|
||||
case (OMPI_ERRHANDLER_TYPE_FILE):
|
||||
new_errhandler->eh_file_fn = (MPI_File_errhandler_fn *)func;
|
||||
break;
|
||||
case (OMPI_ERRHANDLER_TYPE_WIN):
|
||||
new_errhandler->eh_win_fn = (MPI_Win_errhandler_fn *)func;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
new_errhandler->eh_fort_fn = (ompi_errhandler_fortran_handler_fn_t *)func;
|
||||
}
|
||||
}
|
||||
|
||||
@ -175,6 +197,15 @@ static void ompi_errhandler_construct(ompi_errhandler_t *new_errhandler)
|
||||
ret_val = ompi_pointer_array_add(ompi_errhandler_f_to_c_table,
|
||||
new_errhandler);
|
||||
new_errhandler->eh_f_to_c_index = ret_val;
|
||||
|
||||
new_errhandler->eh_fortran_function = 0;
|
||||
|
||||
new_errhandler->eh_comm_fn = NULL;
|
||||
new_errhandler->eh_win_fn = NULL;
|
||||
new_errhandler->eh_file_fn = NULL;
|
||||
new_errhandler->eh_fort_fn = NULL;
|
||||
|
||||
memset (new_errhandler->eh_name, 0, MPI_MAX_OBJECT_NAME);
|
||||
}
|
||||
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "class/ompi_pointer_array.h"
|
||||
#include "mpi/runtime/mpiruntime.h"
|
||||
#include "errhandler/errhandler_predefined.h"
|
||||
#include "errhandler/errcode-internal.h"
|
||||
|
||||
/*
|
||||
* These must correspond to the fortran handle indices
|
||||
@ -29,11 +30,17 @@ enum {
|
||||
*/
|
||||
typedef void (ompi_errhandler_fortran_handler_fn_t)(int *, int *, ...);
|
||||
|
||||
/**
|
||||
* Typedef for generic errhandler function
|
||||
*/
|
||||
typedef void (ompi_errhandler_generic_handler_fn_t)(void *, int *, ...);
|
||||
|
||||
|
||||
/**
|
||||
* Enum used to describe what kind MPI object an error handler is used for
|
||||
*/
|
||||
enum ompi_errhandler_type_t {
|
||||
OMPI_ERRHANDLER_TYPE_PREDEFINED,
|
||||
OMPI_ERRHANDLER_TYPE_COMM,
|
||||
OMPI_ERRHANDLER_TYPE_WIN,
|
||||
OMPI_ERRHANDLER_TYPE_FILE
|
||||
@ -45,32 +52,24 @@ typedef enum ompi_errhandler_type_t ompi_errhandler_type_t;
|
||||
* Back-end type for MPI_Errorhandler.
|
||||
*/
|
||||
struct ompi_errhandler_t {
|
||||
ompi_object_t super;
|
||||
ompi_object_t super;
|
||||
|
||||
char eh_name[MPI_MAX_OBJECT_NAME];
|
||||
char eh_name[MPI_MAX_OBJECT_NAME];
|
||||
/* Type of MPI object that this handler is for */
|
||||
|
||||
ompi_errhandler_type_t eh_mpi_object_type;
|
||||
|
||||
/* Type of MPI object that this handler is for */
|
||||
/* Flags about the error handler */
|
||||
bool eh_fortran_function;
|
||||
|
||||
ompi_errhandler_type_t eh_mpi_object_type;
|
||||
/* Function pointers */
|
||||
MPI_Comm_errhandler_fn *eh_comm_fn;
|
||||
MPI_File_errhandler_fn *eh_file_fn;
|
||||
MPI_Win_errhandler_fn *eh_win_fn;
|
||||
ompi_errhandler_fortran_handler_fn_t *eh_fort_fn;
|
||||
|
||||
/* Flags about the error handler */
|
||||
|
||||
bool eh_is_intrinsic;
|
||||
bool eh_fortran_function;
|
||||
|
||||
/* Function pointers */
|
||||
|
||||
union {
|
||||
MPI_Comm_errhandler_fn *c_comm_fn;
|
||||
MPI_File_errhandler_fn *c_file_fn;
|
||||
MPI_Win_errhandler_fn *c_win_fn;
|
||||
|
||||
ompi_errhandler_fortran_handler_fn_t *fort_fn;
|
||||
} eh_func;
|
||||
|
||||
/* index in Fortran <-> C translation array */
|
||||
|
||||
int eh_f_to_c_index;
|
||||
/* index in Fortran <-> C translation array */
|
||||
int eh_f_to_c_index;
|
||||
};
|
||||
typedef struct ompi_errhandler_t ompi_errhandler_t;
|
||||
|
||||
@ -106,7 +105,7 @@ extern ompi_pointer_array_t *ompi_errhandler_f_to_c_table;
|
||||
*/
|
||||
#define OMPI_ERR_INIT_FINALIZE(name) \
|
||||
if (!ompi_mpi_initialized || ompi_mpi_finalized) { \
|
||||
ompi_mpi_errors_are_fatal_handler(NULL, NULL, name); \
|
||||
ompi_mpi_errors_are_fatal_comm_handler(NULL, NULL, name); \
|
||||
}
|
||||
|
||||
/**
|
||||
@ -125,8 +124,11 @@ extern ompi_pointer_array_t *ompi_errhandler_f_to_c_table;
|
||||
* parallel invocation to OMPI_ERRHANDLER_CHECK() and OMPI_ERRHANDLER_RETURN().
|
||||
*/
|
||||
#define OMPI_ERRHANDLER_INVOKE(mpi_object, err_code, message) \
|
||||
ompi_errhandler_invoke((mpi_object) != NULL ? (mpi_object)->error_handler : NULL, (mpi_object), \
|
||||
(err_code), (message));
|
||||
ompi_errhandler_invoke((mpi_object) != NULL ? (mpi_object)->error_handler : NULL, \
|
||||
(mpi_object), \
|
||||
(int)(mpi_object)->errhandler_type, \
|
||||
(err_code < 0 ? (ompi_errcode_get_mpi_code(err_code)) : err_code), \
|
||||
(message));
|
||||
|
||||
/**
|
||||
* Conditionally invoke an MPI error handler.
|
||||
@ -143,10 +145,13 @@ extern ompi_pointer_array_t *ompi_errhandler_f_to_c_table;
|
||||
*/
|
||||
#define OMPI_ERRHANDLER_CHECK(rc, mpi_object, err_code, message) \
|
||||
if (rc != OMPI_SUCCESS) { \
|
||||
ompi_errhandler_invoke((mpi_object) != NULL ? \
|
||||
(mpi_object)->error_handler : NULL, (mpi_object), \
|
||||
(err_code), (message)); \
|
||||
return (err_code); \
|
||||
int __mpi_err_code = (err_code < 0 ? (ompi_errcode_get_mpi_code(err_code)) : err_code); \
|
||||
ompi_errhandler_invoke((mpi_object) != NULL ? (mpi_object)->error_handler : NULL, \
|
||||
(mpi_object), \
|
||||
(int) (mpi_object)->errhandler_type, \
|
||||
(__mpi_err_code), \
|
||||
(message)); \
|
||||
return (__mpi_err_code); \
|
||||
}
|
||||
|
||||
/**
|
||||
@ -166,9 +171,13 @@ extern ompi_pointer_array_t *ompi_errhandler_f_to_c_table;
|
||||
*/
|
||||
#define OMPI_ERRHANDLER_RETURN(rc, mpi_object, err_code, message) \
|
||||
if (rc != OMPI_SUCCESS) { \
|
||||
ompi_errhandler_invoke((mpi_object != NULL) ? (mpi_object)->error_handler : NULL, (mpi_object), \
|
||||
(err_code), (message)); \
|
||||
return (err_code); \
|
||||
int __mpi_err_code = (err_code < 0 ? (ompi_errcode_get_mpi_code(err_code)) : err_code); \
|
||||
ompi_errhandler_invoke((mpi_object != NULL) ? (mpi_object)->error_handler : NULL, \
|
||||
(mpi_object), \
|
||||
(int)(mpi_object)->errhandler_type, \
|
||||
(__mpi_err_code), \
|
||||
(message)); \
|
||||
return (__mpi_err_code); \
|
||||
} else { \
|
||||
return MPI_SUCCESS; \
|
||||
}
|
||||
@ -210,6 +219,10 @@ extern "C" {
|
||||
* @param errhandler The MPI_Errhandler to invoke
|
||||
* @param mpi_object The MPI object to invoke the errhandler on (a
|
||||
* comm, win, or win)
|
||||
* @param type The type of the MPI object. Necessary, since
|
||||
* you can not assign a single type to the predefined
|
||||
* error handlers. This information is therefore
|
||||
* stored on the MPI object itself.
|
||||
* @param err_code The error code
|
||||
* @param message Any additional message; typically the name of the
|
||||
* MPI function that is invoking the error.
|
||||
@ -225,7 +238,7 @@ extern "C" {
|
||||
* may not return (e.g., for MPI_ERRORS_ARE_FATAL).
|
||||
*/
|
||||
int ompi_errhandler_invoke(ompi_errhandler_t *errhandler, void *mpi_object,
|
||||
int err_code, const char *message);
|
||||
int type, int err_code, const char *message);
|
||||
|
||||
|
||||
/**
|
||||
@ -255,7 +268,7 @@ extern "C" {
|
||||
* flag to true manually.
|
||||
*/
|
||||
ompi_errhandler_t *ompi_errhandler_create(ompi_errhandler_type_t object_type,
|
||||
ompi_errhandler_fortran_handler_fn_t *func);
|
||||
ompi_errhandler_generic_handler_fn_t *func);
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
@ -275,7 +288,10 @@ extern "C" {
|
||||
*/
|
||||
static inline bool ompi_errhandler_is_intrinsic(ompi_errhandler_t *errhandler)
|
||||
{
|
||||
return errhandler->eh_is_intrinsic;
|
||||
if ( OMPI_ERRHANDLER_TYPE_PREDEFINED == errhandler->eh_mpi_object_type )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif /* OMPI_ERRHANDLER_H */
|
||||
|
@ -11,55 +11,53 @@
|
||||
|
||||
|
||||
int ompi_errhandler_invoke(ompi_errhandler_t *errhandler, void *mpi_object,
|
||||
int err_code, const char *message)
|
||||
int object_type, int err_code, const char *message)
|
||||
{
|
||||
int fortran_handle;
|
||||
ompi_communicator_t *comm;
|
||||
ompi_win_t *win;
|
||||
ompi_file_t *file;
|
||||
|
||||
/* If we got no errorhandler, then just invoke errors_abort */
|
||||
|
||||
if (NULL == errhandler) {
|
||||
ompi_mpi_errors_are_fatal_handler(NULL, NULL, message);
|
||||
}
|
||||
|
||||
/* Figure out what kind of errhandler it is, figure out if it's
|
||||
fortran or C, and then invoke it */
|
||||
|
||||
switch (errhandler->eh_mpi_object_type) {
|
||||
case OMPI_ERRHANDLER_TYPE_COMM:
|
||||
comm = (ompi_communicator_t *) mpi_object;
|
||||
if (errhandler->eh_fortran_function) {
|
||||
fortran_handle = comm->c_f_to_c_index;
|
||||
errhandler->eh_func.fort_fn(&fortran_handle, &err_code);
|
||||
} else {
|
||||
errhandler->eh_func.c_comm_fn(&comm, &err_code, message, NULL);
|
||||
int fortran_handle;
|
||||
ompi_communicator_t *comm;
|
||||
ompi_win_t *win;
|
||||
ompi_file_t *file;
|
||||
|
||||
/* If we got no errorhandler, then just invoke errors_abort */
|
||||
if (NULL == errhandler) {
|
||||
ompi_mpi_errors_are_fatal_comm_handler(NULL, NULL, message);
|
||||
}
|
||||
break;
|
||||
|
||||
/* Figure out what kind of errhandler it is, figure out if it's
|
||||
fortran or C, and then invoke it */
|
||||
|
||||
switch (object_type) {
|
||||
case OMPI_ERRHANDLER_TYPE_COMM:
|
||||
comm = (ompi_communicator_t *) mpi_object;
|
||||
if (errhandler->eh_fortran_function) {
|
||||
fortran_handle = comm->c_f_to_c_index;
|
||||
errhandler->eh_fort_fn(&fortran_handle, &err_code);
|
||||
} else {
|
||||
errhandler->eh_comm_fn(&comm, &err_code, message, NULL);
|
||||
}
|
||||
break;
|
||||
|
||||
case OMPI_ERRHANDLER_TYPE_WIN:
|
||||
win = (ompi_win_t *) mpi_object;
|
||||
if (errhandler->eh_fortran_function) {
|
||||
fortran_handle = win->w_f_to_c_index;
|
||||
errhandler->eh_func.fort_fn(&fortran_handle, &err_code);
|
||||
} else {
|
||||
errhandler->eh_func.c_win_fn(&win, &err_code, message, NULL);
|
||||
case OMPI_ERRHANDLER_TYPE_WIN:
|
||||
win = (ompi_win_t *) mpi_object;
|
||||
if (errhandler->eh_fortran_function) {
|
||||
fortran_handle = win->w_f_to_c_index;
|
||||
errhandler->eh_fort_fn(&fortran_handle, &err_code);
|
||||
} else {
|
||||
errhandler->eh_win_fn(&win, &err_code, message, NULL);
|
||||
}
|
||||
break;
|
||||
|
||||
case OMPI_ERRHANDLER_TYPE_FILE:
|
||||
file = (ompi_file_t *) mpi_object;
|
||||
if (errhandler->eh_fortran_function) {
|
||||
fortran_handle = file->f_f_to_c_index;
|
||||
errhandler->eh_fort_fn(&fortran_handle, &err_code);
|
||||
} else {
|
||||
errhandler->eh_file_fn(&file, &err_code, message, NULL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case OMPI_ERRHANDLER_TYPE_FILE:
|
||||
file = (ompi_file_t *) mpi_object;
|
||||
if (errhandler->eh_fortran_function) {
|
||||
fortran_handle = file->f_f_to_c_index;
|
||||
errhandler->eh_func.fort_fn(&fortran_handle, &err_code);
|
||||
} else {
|
||||
errhandler->eh_func.c_file_fn(&file, &err_code, message, NULL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* All done */
|
||||
|
||||
return err_code;
|
||||
|
||||
/* All done */
|
||||
return err_code;
|
||||
}
|
||||
|
@ -14,11 +14,13 @@
|
||||
#include "errhandler/errhandler_predefined.h"
|
||||
#include "errhandler/errcode.h"
|
||||
#include "communicator/communicator.h"
|
||||
#include "file/file.h"
|
||||
#include "win/win.h"
|
||||
#include "runtime/runtime.h"
|
||||
|
||||
|
||||
void ompi_mpi_errors_are_fatal_handler(struct ompi_communicator_t **comm,
|
||||
int *error_code, ...)
|
||||
void ompi_mpi_errors_are_fatal_comm_handler(struct ompi_communicator_t **comm,
|
||||
int *error_code, ...)
|
||||
{
|
||||
char *arg;
|
||||
va_list arglist;
|
||||
@ -64,8 +66,112 @@ void ompi_mpi_errors_are_fatal_handler(struct ompi_communicator_t **comm,
|
||||
}
|
||||
|
||||
|
||||
void ompi_mpi_errors_return_handler(struct ompi_communicator_t **comm,
|
||||
int *error_code, ...)
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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, ...)
|
||||
{
|
||||
/* Don't need anything more -- just need this function to exist */
|
||||
}
|
||||
|
@ -9,13 +9,22 @@
|
||||
/**
|
||||
* Handler function for MPI_ERRORS_ARE_FATAL
|
||||
*/
|
||||
void ompi_mpi_errors_are_fatal_handler(struct ompi_communicator_t **comm,
|
||||
int *error_code, ...);
|
||||
void ompi_mpi_errors_are_fatal_comm_handler(struct ompi_communicator_t **comm,
|
||||
int *error_code, ...);
|
||||
void ompi_mpi_errors_are_fatal_file_handler(struct ompi_file_t **file,
|
||||
int *error_code, ...);
|
||||
void ompi_mpi_errors_are_fatal_win_handler(struct ompi_win_t **win,
|
||||
int *error_code, ...);
|
||||
|
||||
/**
|
||||
* Handler function for MPI_ERRORS_RETURN
|
||||
*/
|
||||
void ompi_mpi_errors_return_handler(struct ompi_communicator_t **comm,
|
||||
void ompi_mpi_errors_return_comm_handler(struct ompi_communicator_t **comm,
|
||||
int *error_code, ...);
|
||||
void ompi_mpi_errors_return_file_handler(struct ompi_file_t **file,
|
||||
int *error_code, ...);
|
||||
void ompi_mpi_errors_return_win_handler(struct ompi_win_t **win,
|
||||
int *error_code, ...);
|
||||
|
||||
|
||||
#endif /* OMPI_ERRHANDLER_PREDEFINED_H */
|
||||
|
@ -174,6 +174,7 @@ static void file_constructor(ompi_file_t *file)
|
||||
file->f_comm = NULL;
|
||||
file->f_filename = NULL;
|
||||
file->f_amode = 0;
|
||||
file->errhandler_type = OMPI_ERRHANDLER_TYPE_FILE;
|
||||
|
||||
/* Initialize flags */
|
||||
|
||||
|
@ -64,7 +64,8 @@ struct ompi_file_t {
|
||||
int f_f_to_c_index;
|
||||
/**< Index in Fortran <-> C translation array */
|
||||
|
||||
ompi_errhandler_t *error_handler;
|
||||
ompi_errhandler_t *error_handler;
|
||||
ompi_errhandler_type_t errhandler_type;
|
||||
/**< Error handler. This field does not have the "f_" prefix so
|
||||
that the OMPI_ERRHDL_* macros can find it, regardless of
|
||||
whether it's a comm, window, or file. */
|
||||
|
@ -42,7 +42,7 @@ int MPI_Comm_create_errhandler(MPI_Comm_errhandler_fn *function,
|
||||
|
||||
*errhandler =
|
||||
ompi_errhandler_create(OMPI_ERRHANDLER_TYPE_COMM,
|
||||
(ompi_errhandler_fortran_handler_fn_t*) function);
|
||||
(ompi_errhandler_generic_handler_fn_t*) function);
|
||||
if (NULL == *errhandler) {
|
||||
err = MPI_ERR_INTERN;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ int MPI_File_create_errhandler(MPI_File_errhandler_fn *function,
|
||||
|
||||
*errhandler =
|
||||
ompi_errhandler_create(OMPI_ERRHANDLER_TYPE_FILE,
|
||||
(ompi_errhandler_fortran_handler_fn_t*) function);
|
||||
(ompi_errhandler_generic_handler_fn_t*) function);
|
||||
if (NULL == *errhandler) {
|
||||
err = MPI_ERR_INTERN;
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ int MPI_Win_create_errhandler(MPI_Win_errhandler_fn *function,
|
||||
|
||||
*errhandler =
|
||||
ompi_errhandler_create(OMPI_ERRHANDLER_TYPE_WIN,
|
||||
(ompi_errhandler_fortran_handler_fn_t*) function);
|
||||
(ompi_errhandler_generic_handler_fn_t*) function);
|
||||
if (NULL == *errhandler) {
|
||||
err = MPI_ERR_INTERN;
|
||||
}
|
||||
|
@ -29,8 +29,8 @@ struct ompi_win_t {
|
||||
/* Error handling. This field does not have the "w_" prefix so that
|
||||
the OMPI_ERRHDL_* macros can find it, regardless of whether it's a
|
||||
comm, window, or file. */
|
||||
|
||||
ompi_errhandler_t *error_handler;
|
||||
ompi_errhandler_t *error_handler;
|
||||
ompi_errhandler_type_t errhandler_type;
|
||||
};
|
||||
|
||||
typedef struct ompi_win_t ompi_win_t;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user