From 27d35cbb142dff384319a35427053b29469d5f3c Mon Sep 17 00:00:00 2001 From: dmitrygx Date: Thu, 22 Oct 2020 21:03:06 +0000 Subject: [PATCH] UCP/CORE: Rename request RECV flag to RECV_TAG to align with SEND --- src/ucp/core/ucp_request.c | 4 ++-- src/ucp/core/ucp_request.h | 4 ++-- src/ucp/core/ucp_request.inl | 3 ++- src/ucp/rndv/rndv.c | 5 ++++- src/ucp/tag/tag_recv.c | 5 +++-- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/ucp/core/ucp_request.c b/src/ucp/core/ucp_request.c index 5afd8c0c722..3447bf66a91 100644 --- a/src/ucp/core/ucp_request.c +++ b/src/ucp/core/ucp_request.c @@ -45,7 +45,7 @@ ucs_status_t ucp_tag_recv_request_test(void *request, ucp_tag_recv_info_t *info) ucs_status_t status = ucp_request_check_status(request); if (status != UCS_INPROGRESS) { - ucs_assert(req->flags & UCP_REQUEST_FLAG_RECV); + ucs_assert(req->flags & UCP_REQUEST_FLAG_RECV_TAG); *info = req->recv.tag.info; } @@ -312,7 +312,7 @@ ucs_status_t ucp_request_test(void *request, ucp_tag_recv_info_t *info) ucp_request_t *req = (ucp_request_t*)request - 1; if (req->flags & UCP_REQUEST_FLAG_COMPLETED) { - if (req->flags & UCP_REQUEST_FLAG_RECV) { + if (req->flags & UCP_REQUEST_FLAG_RECV_TAG) { *info = req->recv.tag.info; } ucs_assert(req->status != UCS_INPROGRESS); diff --git a/src/ucp/core/ucp_request.h b/src/ucp/core/ucp_request.h index b08c1f1585b..2cb908bea1e 100644 --- a/src/ucp/core/ucp_request.h +++ b/src/ucp/core/ucp_request.h @@ -43,7 +43,7 @@ enum { UCP_REQUEST_FLAG_LOCAL_COMPLETED = UCS_BIT(4), UCP_REQUEST_FLAG_REMOTE_COMPLETED = UCS_BIT(5), UCP_REQUEST_FLAG_CALLBACK = UCS_BIT(6), - UCP_REQUEST_FLAG_RECV = UCS_BIT(7), + UCP_REQUEST_FLAG_PROTO_INITIALIZED = UCS_BIT(7), UCP_REQUEST_FLAG_SYNC = UCS_BIT(8), UCP_REQUEST_FLAG_OFFLOADED = UCS_BIT(10), UCP_REQUEST_FLAG_BLOCK_OFFLOAD = UCS_BIT(11), @@ -52,7 +52,7 @@ enum { UCP_REQUEST_FLAG_SEND_TAG = UCS_BIT(14), UCP_REQUEST_FLAG_RNDV_FRAG = UCS_BIT(15), UCP_REQUEST_FLAG_RECV_AM = UCS_BIT(16), - UCP_REQUEST_FLAG_PROTO_INITIALIZED = UCS_BIT(17), + UCP_REQUEST_FLAG_RECV_TAG = UCS_BIT(17), #if UCS_ENABLE_ASSERT UCP_REQUEST_FLAG_STREAM_RECV = UCS_BIT(18), UCP_REQUEST_DEBUG_FLAG_EXTERNAL = UCS_BIT(19) diff --git a/src/ucp/core/ucp_request.inl b/src/ucp/core/ucp_request.inl index 7e8b26809ad..172f67af106 100644 --- a/src/ucp/core/ucp_request.inl +++ b/src/ucp/core/ucp_request.inl @@ -30,7 +30,8 @@ (((_flags) & UCP_REQUEST_FLAG_EXPECTED) ? 'e' : '-'), \ (((_flags) & UCP_REQUEST_FLAG_LOCAL_COMPLETED) ? 'L' : '-'), \ (((_flags) & UCP_REQUEST_FLAG_CALLBACK) ? 'c' : '-'), \ - (((_flags) & UCP_REQUEST_FLAG_RECV) ? 'r' : '-'), \ + (((_flags) & (UCP_REQUEST_FLAG_RECV_TAG | \ + UCP_REQUEST_FLAG_RECV_AM)) ? 'r' : '-'), \ (((_flags) & UCP_REQUEST_FLAG_SYNC) ? 's' : '-') #define UCP_RECV_DESC_FMT \ diff --git a/src/ucp/rndv/rndv.c b/src/ucp/rndv/rndv.c index 6bf68f98fc8..c4a3c208f5e 100644 --- a/src/ucp/rndv/rndv.c +++ b/src/ucp/rndv/rndv.c @@ -357,6 +357,7 @@ ucp_rndv_recv_req_complete(ucp_request_t *req, ucs_status_t status) if (req->flags & UCP_REQUEST_FLAG_RECV_AM) { ucp_request_complete_am_recv(req, status); } else { + ucs_assert(req->flags & UCP_REQUEST_FLAG_RECV_TAG); ucp_request_complete_tag_recv(req, status); } } @@ -1769,7 +1770,9 @@ UCS_PROFILE_FUNC(ucs_status_t, ucp_rndv_data_handler, size_t recv_len; rreq = ucp_worker_get_request_by_id(worker, rndv_data_hdr->rreq_id); - ucs_assert(!(rreq->flags & UCP_REQUEST_FLAG_RNDV_FRAG)); + ucs_assert(!(rreq->flags & UCP_REQUEST_FLAG_RNDV_FRAG) && + (rreq->flags & (UCP_REQUEST_FLAG_RECV_AM | + UCP_REQUEST_FLAG_RECV_TAG))); recv_len = length - sizeof(*rndv_data_hdr); UCS_PROFILE_REQUEST_EVENT(rreq, "rndv_data_recv", recv_len); diff --git a/src/ucp/tag/tag_recv.c b/src/ucp/tag/tag_recv.c index 59cf17c4ff2..c0a19d1aa18 100644 --- a/src/ucp/tag/tag_recv.c +++ b/src/ucp/tag/tag_recv.c @@ -25,7 +25,8 @@ ucp_tag_recv_common(ucp_worker_h worker, void *buffer, size_t count, ucp_request_t *req, ucp_recv_desc_t *rdesc, const ucp_request_param_t *param, const char *debug_name) { - unsigned common_flags = UCP_REQUEST_FLAG_RECV | UCP_REQUEST_FLAG_EXPECTED; + unsigned common_flags = UCP_REQUEST_FLAG_RECV_TAG | + UCP_REQUEST_FLAG_EXPECTED; uint32_t req_flags = (param->op_attr_mask & UCP_OP_ATTR_FIELD_CALLBACK) ? UCP_REQUEST_FLAG_CALLBACK : 0; ucp_eager_first_hdr_t *eagerf_hdr; @@ -53,7 +54,7 @@ ucp_tag_recv_common(ucp_worker_h worker, void *buffer, size_t count, } req->flags = UCP_REQUEST_FLAG_COMPLETED | - UCP_REQUEST_FLAG_RECV; + UCP_REQUEST_FLAG_RECV_TAG; hdr_len = rdesc->payload_offset; recv_len = rdesc->length - hdr_len; req->recv.tag.info.sender_tag = ucp_rdesc_get_tag(rdesc);