Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

communicator: add errhandler_type back #11818

Merged
merged 1 commit into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ompi/communicator/comm_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ static void ompi_comm_construct(ompi_communicator_t* comm)
/* A keyhash will be created if/when an attribute is cached on
this communicator */
comm->c_keyhash = NULL;

comm->errhandler_type = OMPI_ERRHANDLER_TYPE_COMM;
comm->error_handler = &ompi_mpi_errors_are_fatal.eh;
#ifdef OMPI_WANT_PERUSE
comm->c_peruse_handles = NULL;
Expand Down
1 change: 1 addition & 0 deletions ompi/communicator/communicator.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ 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_type_t errhandler_type;

/* Hooks for PML to hang things */
struct mca_pml_comm_t *c_pml_comm;
Expand Down
7 changes: 6 additions & 1 deletion ompi/debuggers/predefined_gap_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ int main(int argc, char **argv) {
#else
GAP_CHECK("error_handler", test_comm, error_handler, c_f_to_c_index, 1);
#endif
GAP_CHECK("errhandler_type", test_comm, errhandler_type, error_handler, 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is another line that needs to be added back (in fact, looking at it now I am not sure the code was correct before, but I am not completely sure I understand how the debugger interfaces work). It seems that we are always checking for the distance from the previous element of the structure.
GAP_CHECK("c_pml_comm", test_comm, c_pml_comm, errhandler_type, 1);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

added in new revision

GAP_CHECK("c_pml_comm", test_comm, c_pml_comm, errhandler_type, 1);
GAP_CHECK("c_coll", test_comm, c_coll, c_pml_comm, 1);

/* Test Predefined group sizes */
Expand Down Expand Up @@ -125,7 +127,8 @@ int main(int argc, char **argv) {
GAP_CHECK("w_keyhash", test_win, w_keyhash, w_flags, 1);
GAP_CHECK("w_f_to_c_index", test_win, w_f_to_c_index, w_keyhash, 1);
GAP_CHECK("error_handler", test_win, error_handler, w_f_to_c_index, 1);

GAP_CHECK("errhandler_type", test_win, errhandler_type, error_handler, 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here as well:
GAP_CHECK("w_osc_module", test_win, w_osc_module, errhandler_type, 1);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

GAP_CHECK("w_osc_module", test_win, w_osc_module, errhandler_type, 1);
/* Test Predefined info sizes */
printf("=============================================\n");
printf("ompi_predefined_info_t = %lu bytes\n", sizeof(ompi_predefined_info_t));
Expand All @@ -145,6 +148,8 @@ int main(int argc, char **argv) {
GAP_CHECK("f_flags", test_file, f_flags, f_amode, 1);
GAP_CHECK("f_f_to_c_index", test_file, f_f_to_c_index, f_flags, 1);
GAP_CHECK("error_handler", test_file, error_handler, f_f_to_c_index, 1);
GAP_CHECK("errhandler_type", test_file, errhandler_type, error_handler, 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here too
GAP_CHECK("f_io_version", test_file, f_io_version, errhandler_type, 1);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

GAP_CHECK("f_io_version", test_file, f_io_version, errhandler_type, 1);
GAP_CHECK("f_io_selected_component", test_file, f_io_selected_component, f_io_version, 1);
GAP_CHECK("f_io_selected_module", test_file, f_io_selected_module, f_io_selected_component, 1);
GAP_CHECK("f_io_selected_data", test_file, f_io_selected_data, f_io_selected_module, 1);
Expand Down
8 changes: 4 additions & 4 deletions ompi/errhandler/errhandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,10 @@ int ompi_errhandler_proc_failed_internal(ompi_proc_t* ompi_proc, int status, boo
OMPI_NAME_PRINT(&ompi_proc->super.proc_name),
ompi_comm_print_cid(comm),
proc_rank,
(OMPI_ERRHANDLER_TYPE_PREDEFINED == comm->error_handler->eh_mpi_object_type ? "P" :
(OMPI_ERRHANDLER_TYPE_COMM == comm->error_handler->eh_mpi_object_type ? "C" :
(OMPI_ERRHANDLER_TYPE_WIN == comm->error_handler->eh_mpi_object_type ? "W" :
(OMPI_ERRHANDLER_TYPE_FILE == comm->error_handler->eh_mpi_object_type ? "F" : "U") ) ) )
(OMPI_ERRHANDLER_TYPE_PREDEFINED == comm->errhandler_type ? "P" :
(OMPI_ERRHANDLER_TYPE_COMM == comm->errhandler_type ? "C" :
(OMPI_ERRHANDLER_TYPE_WIN == comm->errhandler_type ? "W" :
(OMPI_ERRHANDLER_TYPE_FILE == comm->errhandler_type ? "F" : "U") ) ) )
));
}

Expand Down
6 changes: 3 additions & 3 deletions ompi/errhandler/errhandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ extern opal_atomic_int32_t ompi_instance_count;
#define OMPI_ERRHANDLER_INVOKE(mpi_object, err_code, message) \
ompi_errhandler_invoke((mpi_object)->error_handler, \
(mpi_object), \
(int)(mpi_object)->error_handler->eh_mpi_object_type, \
(int)(mpi_object)->errhandler_type, \
ompi_errcode_get_mpi_code(err_code), \
(message));

Expand Down Expand Up @@ -269,7 +269,7 @@ extern opal_atomic_int32_t ompi_instance_count;
int __mpi_err_code = ompi_errcode_get_mpi_code(err_code); \
ompi_errhandler_invoke((mpi_object)->error_handler, \
(mpi_object), \
(int) (mpi_object)->error_handler->eh_mpi_object_type, \
(int) (mpi_object)->errhandler_type, \
(__mpi_err_code), \
(message)); \
return (__mpi_err_code); \
Expand Down Expand Up @@ -307,7 +307,7 @@ extern opal_atomic_int32_t ompi_instance_count;
int __mpi_err_code = ompi_errcode_get_mpi_code(err_code); \
ompi_errhandler_invoke((mpi_object)->error_handler, \
(mpi_object), \
(int)(mpi_object)->error_handler->eh_mpi_object_type, \
(int)(mpi_object)->errhandler_type, \
(__mpi_err_code), \
(message)); \
return (__mpi_err_code); \
Expand Down
6 changes: 3 additions & 3 deletions ompi/errhandler/errhandler_invoke.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,19 +202,19 @@ int ompi_errhandler_request_invoke(int count,
case OMPI_REQUEST_COLL:
return ompi_errhandler_invoke(mpi_object.comm->error_handler,
mpi_object.comm,
mpi_object.comm->error_handler->eh_mpi_object_type,
mpi_object.comm->errhandler_type,
ec, message);
break;
case OMPI_REQUEST_IO:
return ompi_errhandler_invoke(mpi_object.file->error_handler,
mpi_object.file,
mpi_object.file->error_handler->eh_mpi_object_type,
mpi_object.file->errhandler_type,
ec, message);
break;
case OMPI_REQUEST_WIN:
return ompi_errhandler_invoke(mpi_object.win->error_handler,
mpi_object.win,
mpi_object.win->error_handler->eh_mpi_object_type,
mpi_object.win->errhandler_type,
ec, message);
break;
default:
Expand Down