Skip to content

Commit 89c0dde

Browse files
committed
mtl/ofi: log request type on callback error
Currently the log does not provide enough information to debug callback failures. This patch adds the request type to guide the developer to the corresponding callback function. Signed-off-by: Wenduo Wang <[email protected]> (cherry picked from commit be1e421)
1 parent 5939b25 commit 89c0dde

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

ompi/mca/mtl/ofi/mtl_ofi.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,10 @@ ompi_mtl_ofi_context_progress(int ctxt_id)
153153
assert(ofi_req);
154154
ret = ofi_req->event_callback(&ompi_mtl_ofi_wc[i], ofi_req);
155155
if (OMPI_SUCCESS != ret) {
156-
opal_output(0, "%s:%d: Error returned by request event callback: %zd.\n"
157-
"*** The Open MPI OFI MTL is aborting the MPI job (via exit(3)).\n",
158-
__FILE__, __LINE__, ret);
156+
opal_output(0,
157+
"%s:%d: Error returned by request (type: %d) event callback: %zd.\n"
158+
"*** The Open MPI OFI MTL is aborting the MPI job (via exit(3)).\n",
159+
__FILE__, __LINE__, ofi_req->type, ret);
159160
fflush(stderr);
160161
exit(1);
161162
}
@@ -666,6 +667,7 @@ ompi_mtl_ofi_ssend_recv(ompi_mtl_ofi_request_t *ack_req,
666667
assert(ack_req);
667668

668669
ack_req->parent = ofi_req;
670+
ack_req->type = OMPI_MTL_OFI_ACK;
669671
ack_req->event_callback = ompi_mtl_ofi_send_ack_callback;
670672
ack_req->error_callback = ompi_mtl_ofi_send_ack_error_callback;
671673

@@ -877,6 +879,7 @@ ompi_mtl_ofi_send_generic(struct mca_mtl_base_module_t *mtl,
877879
/**
878880
* Create a send request, start it and wait until it completes.
879881
*/
882+
ofi_req.type = OMPI_MTL_OFI_SEND;
880883
ofi_req.event_callback = ompi_mtl_ofi_send_callback;
881884
ofi_req.error_callback = ompi_mtl_ofi_send_error_callback;
882885

@@ -1125,6 +1128,7 @@ ompi_mtl_ofi_isend_generic(struct mca_mtl_base_module_t *mtl,
11251128
}
11261129
set_thread_context(ctxt_id);
11271130

1131+
ofi_req->type = OMPI_MTL_OFI_SEND;
11281132
ofi_req->event_callback = ompi_mtl_ofi_isend_callback;
11291133
ofi_req->error_callback = ompi_mtl_ofi_send_error_callback;
11301134

@@ -1137,7 +1141,6 @@ ompi_mtl_ofi_isend_generic(struct mca_mtl_base_module_t *mtl,
11371141
ompi_ret = ompi_mtl_datatype_pack(convertor, &start, &length, &free_after);
11381142
if (OPAL_UNLIKELY(OMPI_SUCCESS != ompi_ret)) return ompi_ret;
11391143

1140-
ofi_req->type = OMPI_MTL_OFI_SEND;
11411144
ofi_req->buffer = (free_after) ? start : NULL;
11421145
ofi_req->length = length;
11431146
ofi_req->status.MPI_ERROR = OMPI_SUCCESS;

0 commit comments

Comments
 (0)