Skip to content

Commit

Permalink
Merge pull request #5826 from dmitrygx/topic/ucp/request_flag
Browse files Browse the repository at this point in the history
UCP/CORE: Rename request RECV flag to RECV_TAG to align with SEND
  • Loading branch information
yosefe authored Oct 23, 2020
2 parents dba3348 + 27d35cb commit ba2fe95
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/ucp/core/ucp_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/ucp/core/ucp_request.h
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/ucp/core/ucp_request.inl
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
5 changes: 4 additions & 1 deletion src/ucp/rndv/rndv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions src/ucp/tag/tag_recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ba2fe95

Please sign in to comment.