Skip to content

Commit 31006fd

Browse files
committed
Infrastructure to test for MPI object error handler, not used yet
Signed-off-by: Joseph Schuchart <[email protected]>
1 parent 3715379 commit 31006fd

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

ompi/mpiext/continue/c/continuation.c

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
#include "ompi/mpiext/continue/c/continuation.h"
2323
#include "ompi/request/request.h"
2424

25+
#include "ompi/communicator/communicator.h"
26+
#include "ompi/file/file.h"
27+
#include "ompi/win/win.h"
28+
2529

2630
static opal_free_list_t ompi_continuation_freelist;
2731
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,
235239
uint32_t max_poll,
236240
thread_local_data_t *tld);
237241

242+
static inline
243+
int ompi_continue_check_request_error_abort(ompi_request_t *req);
244+
238245
static inline
239246
void ompi_continue_cont_release(ompi_continuation_t *cont, int rc)
240247
{
@@ -1088,3 +1095,39 @@ void ompi_continue_get_error_info(
10881095
*mpi_object = cont_req->cont_errorinfo.mpi_object;
10891096
*mpi_object_type = cont_req->cont_errorinfo.type;
10901097
}
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

Comments
 (0)