Don't bother trying to use the fancy schmancy ERRHANDLER macros when
invoking an errhandler in MPI_INIT when we don't yet have a communicator to invoke them on. Instead, remove some of the logic from the ERRHANDLER macros and just invoke the back-end function directly in MPI_INIT. This commit was SVN r2692.
Этот коммит содержится в:
родитель
7a0c3fd490
Коммит
ae6ff056d1
@ -124,7 +124,7 @@ 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, \
|
||||
ompi_errhandler_invoke((mpi_object)->error_handler, \
|
||||
(mpi_object), \
|
||||
(int)(mpi_object)->errhandler_type, \
|
||||
(err_code < 0 ? (ompi_errcode_get_mpi_code(err_code)) : err_code), \
|
||||
@ -146,7 +146,7 @@ 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) { \
|
||||
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, \
|
||||
ompi_errhandler_invoke((mpi_object)->error_handler, \
|
||||
(mpi_object), \
|
||||
(int) (mpi_object)->errhandler_type, \
|
||||
(__mpi_err_code), \
|
||||
@ -172,7 +172,7 @@ 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) { \
|
||||
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, \
|
||||
ompi_errhandler_invoke((mpi_object)->error_handler, \
|
||||
(mpi_object), \
|
||||
(int)(mpi_object)->errhandler_type, \
|
||||
(__mpi_err_code), \
|
||||
|
@ -30,13 +30,13 @@ int MPI_Init(int *argc, char ***argv)
|
||||
int provided;
|
||||
char *env;
|
||||
int required = MPI_THREAD_SINGLE;
|
||||
MPI_Comm null = NULL;
|
||||
|
||||
/* Ensure that we were not already initialized or finalized */
|
||||
|
||||
if (ompi_mpi_finalized) {
|
||||
/* JMS show_help */
|
||||
return OMPI_ERRHANDLER_INVOKE(null, MPI_ERR_OTHER, FUNC_NAME);
|
||||
/* JMS show_help */
|
||||
return ompi_errhandler_invoke(NULL, NULL, OMPI_ERRHANDLER_TYPE_COMM,
|
||||
MPI_ERR_OTHER, FUNC_NAME);
|
||||
} else if (ompi_mpi_initialized) {
|
||||
/* JMS show_help */
|
||||
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME);
|
||||
@ -62,5 +62,16 @@ int MPI_Init(int *argc, char ***argv)
|
||||
} else {
|
||||
err = ompi_mpi_init(0, NULL, required, &provided);
|
||||
}
|
||||
OMPI_ERRHANDLER_RETURN(err, null, err, FUNC_NAME);
|
||||
|
||||
/* Since we don't have a communicator to invoke an errorhandler on
|
||||
here, don't use the fancy-schmancy ERRHANDLER macros; they're
|
||||
really designed for real communicator objects. Just use the
|
||||
back-end function directly. */
|
||||
|
||||
if (MPI_SUCCESS != err) {
|
||||
return ompi_errhandler_invoke(NULL, NULL, OMPI_ERRHANDLER_TYPE_COMM,
|
||||
err < 0 ? ompi_errcode_get_mpi_code(err) :
|
||||
err, FUNC_NAME);
|
||||
}
|
||||
return MPI_SUCCESS;
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user