Skip to content

Commit

Permalink
UCP/RNDV: Fix rndv cancel handling
Browse files Browse the repository at this point in the history
  • Loading branch information
yosefe committed Sep 17, 2020
1 parent 7693cde commit 13d6039
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/ucp/core/ucp_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,11 @@ void ucp_request_handle_send_error(ucp_request_t *req, ucs_status_t status)
req->send.state.uct_comp.func(&req->send.state.uct_comp, status);
}
} else {
ucp_request_complete_send(req, status);
if (req->flags & UCP_REQUEST_FLAG_SEND_RNDV) {
ucp_rndv_complete_send(req, UCS_ERR_CANCELED, "rndv_flush");
} else {
ucp_request_complete_send(req, status);
}
}
}

Expand Down
8 changes: 5 additions & 3 deletions src/ucp/tag/rndv.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ static int ucp_rndv_is_recv_pipeline_needed(ucp_request_t *rndv_req,
return 1;
}

static void ucp_rndv_complete_send(ucp_request_t *sreq, ucs_status_t status,
const char *debug_status)
void ucp_rndv_complete_send(ucp_request_t *sreq, ucs_status_t status,
const char *debug_status)
{
ucp_worker_h worker;
khiter_t iter;
Expand Down Expand Up @@ -403,7 +403,9 @@ ucs_status_t ucp_tag_send_start_rndv(ucp_request_t *sreq)
void ucp_tag_rndv_cancel(ucp_request_t *sreq)
{
if (!(sreq->send.ep->flags & UCP_EP_FLAG_REMOTE_CONNECTED)) {
ucp_rndv_complete_send(sreq, UCS_ERR_CANCELED, "rndv_cancel");
if (sreq->flags & UCP_REQUEST_FLAG_RNDV_RTS_SENT) {
ucp_rndv_complete_send(sreq, UCS_ERR_CANCELED, "rndv_cancel");
}
} else {
sreq->send.uct.func = ucp_proto_progress_rndv_cancel;
if (sreq->flags & UCP_REQUEST_FLAG_RNDV_RTS_SENT) {
Expand Down
3 changes: 3 additions & 0 deletions src/ucp/tag/rndv.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ ucs_status_t ucp_tag_send_start_rndv(ucp_request_t *req);

void ucp_tag_rndv_cancel(ucp_request_t *sreq);

void ucp_rndv_complete_send(ucp_request_t *sreq, ucs_status_t status,
const char *debug_status);

void ucp_rndv_matched(ucp_worker_h worker, ucp_request_t *req,
const ucp_rndv_rts_hdr_t *rndv_rts_hdr,
uint64_t rts_seq);
Expand Down

0 comments on commit 13d6039

Please sign in to comment.