|
22 | 22 | #include "ompi/mpiext/continue/c/continuation.h" |
23 | 23 | #include "ompi/request/request.h" |
24 | 24 |
|
| 25 | +#include "ompi/communicator/communicator.h" |
| 26 | +#include "ompi/file/file.h" |
| 27 | +#include "ompi/win/win.h" |
| 28 | + |
25 | 29 |
|
26 | 30 | static opal_free_list_t ompi_continuation_freelist; |
27 | 31 | static opal_free_list_t ompi_request_cont_data_freelist; |
@@ -235,6 +239,9 @@ int ompi_continue_progress_request_n(ompi_cont_request_t *cont_req, |
235 | 239 | uint32_t max_poll, |
236 | 240 | thread_local_data_t *tld); |
237 | 241 |
|
| 242 | +static inline |
| 243 | +int ompi_continue_check_request_error_abort(ompi_request_t *req); |
| 244 | + |
238 | 245 | static inline |
239 | 246 | void ompi_continue_cont_release(ompi_continuation_t *cont, int rc) |
240 | 247 | { |
@@ -1088,3 +1095,39 @@ void ompi_continue_get_error_info( |
1088 | 1095 | *mpi_object = cont_req->cont_errorinfo.mpi_object; |
1089 | 1096 | *mpi_object_type = cont_req->cont_errorinfo.type; |
1090 | 1097 | } |
| 1098 | + |
| 1099 | + |
| 1100 | +static inline __opal_attribute_always_inline__ |
| 1101 | +int ompi_continue_check_errhandler_abort(ompi_errhandler_t* errhandler) |
| 1102 | +{ |
| 1103 | + /* it's safe to use binary OR here, safes a jmp */ |
| 1104 | + return (errhandler == &ompi_mpi_errors_are_fatal.eh | errhandler == &ompi_mpi_errors_abort.eh); |
| 1105 | +} |
| 1106 | + |
| 1107 | +static inline |
| 1108 | +int ompi_continue_check_request_error_abort(ompi_request_t *req) |
| 1109 | +{ |
| 1110 | + ompi_mpi_object_t obj = req->req_mpi_object; |
| 1111 | + switch (req->req_type) { |
| 1112 | + case OMPI_REQUEST_PART: |
| 1113 | + case OMPI_REQUEST_COLL: |
| 1114 | + case OMPI_REQUEST_PML: |
| 1115 | + case OMPI_REQUEST_COMM: // partitioned, coll, p2p, and comm duplication requests have a communicator set |
| 1116 | + return ompi_continue_check_errhandler_abort(obj.comm->error_handler); |
| 1117 | + case OMPI_REQUEST_IO: // file IO requests have a file set |
| 1118 | + return ompi_continue_check_errhandler_abort(obj.file->error_handler); |
| 1119 | + case OMPI_REQUEST_WIN: // RMA requests have a window set |
| 1120 | + return ompi_continue_check_errhandler_abort(obj.win->error_handler); |
| 1121 | + case OMPI_REQUEST_GEN: |
| 1122 | + case OMPI_REQUEST_CONT: // continuation and generalized requests fail on MPI_COMM_SELF |
| 1123 | + return ompi_continue_check_errhandler_abort(ompi_mpi_comm_self.comm.error_handler); |
| 1124 | + case OMPI_REQUEST_NOOP: |
| 1125 | + case OMPI_REQUEST_NULL: |
| 1126 | + case OMPI_REQUEST_MAX: |
| 1127 | + /** |
| 1128 | + * NOTE: not using the default label so a warning is triggered if a new request type is introduced |
| 1129 | + * NULL and NOOP requests do not fail so signal that they are safe to assume they would abort |
| 1130 | + */ |
| 1131 | + return true; |
| 1132 | + } |
| 1133 | +} |
0 commit comments