Repository navigation
UCP/FENCE: Add asynchronous endpoint fence engine #11924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -615,6 +615,11 @@ typedef struct ucp_ep_ext { | |
| uint64_t fence_seq; /* Sequence number for fence | ||
| detection */ | ||
|
|
||
| ucs_queue_head_t fence_pending_q; /* Fence-blocked requests */ | ||
| ucp_request_t *fence_inflight_req; /* Active fence flush */ | ||
| ucs_status_t fence_status; /* Current/last flush status */ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor: |
||
| uint8_t fence_pending_scheduled; /* Progress armed */ | ||
|
|
||
| /** | ||
| * UCT endpoints for every slow-path lane that has no room in the base endpoint | ||
| * structure. TODO allocate this array dynamically. | ||
|
|
@@ -1012,6 +1017,9 @@ void ucp_ep_req_purge(ucp_ep_h ucp_ep, ucp_request_t *req, | |
| */ | ||
| void ucp_ep_reqs_purge(ucp_ep_h ucp_ep, ucs_status_t status); | ||
|
|
||
| void ucp_ep_fence_pending_add(ucp_ep_h ep, uct_pending_req_t *req); | ||
| void ucp_ep_fence_pending_purge(ucp_ep_h ep, ucs_status_t status); | ||
| void ucp_ep_fence_pending_resume(ucp_ep_h ep); | ||
|
|
||
| /** | ||
| * @brief Query local and/or remote socket address of endpoint @a ucp_ep. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,16 @@ | |
| #define ucp_trace_req(_sreq, _message, ...) \ | ||
| ucs_trace_req("req %p: " _message, (_sreq), ## __VA_ARGS__) | ||
|
|
||
| #define UCP_STATUS_FENCE_DEFER ((ucs_status_t)(UCS_ERR_LAST + 1)) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| #ifdef __cplusplus | ||
| static_assert((UCP_STATUS_FENCE_DEFER < UCS_OK) && | ||
| (UCP_STATUS_FENCE_DEFER >= UCS_ERR_LAST), | ||
| "fence defer status must be an error pointer"); | ||
| #else | ||
| _Static_assert((UCP_STATUS_FENCE_DEFER < UCS_OK) && | ||
| (UCP_STATUS_FENCE_DEFER >= UCS_ERR_LAST), | ||
| "fence defer status must be an error pointer"); | ||
| #endif | ||
|
|
||
| /** | ||
| * Request flags | ||
|
|
@@ -69,7 +79,8 @@ enum { | |
| UCP_REQUEST_FLAG_RNDV_SEND_INTERNAL = UCS_BIT(26), | ||
| UCP_REQUEST_FLAG_RNDV_GET_REQ = UCS_BIT(27), | ||
| UCP_REQUEST_FLAG_RNDV_FLUSH = UCS_BIT(28), | ||
| UCP_REQUEST_FLAG_RNDV_START_FLUSH = UCS_BIT(29) | ||
| UCP_REQUEST_FLAG_RNDV_START_FLUSH = UCS_BIT(29), | ||
| UCP_REQUEST_FLAG_FENCE_BLOCKED = UCS_BIT(30) | ||
| }; | ||
|
|
||
|
|
||
|
|
@@ -250,14 +261,31 @@ struct ucp_request { | |
| } msg_proto; | ||
|
|
||
| struct { | ||
| uint64_t remote_addr; /* Remote address */ | ||
| ucp_rkey_h rkey; /* Remote memory key */ | ||
| /* Fence state shared by RMA and atomic send requests. */ | ||
| uint64_t fence_seq; | ||
| ucs_queue_elem_t fence_pending_elem; | ||
|
|
||
| union { | ||
| struct { | ||
| uint64_t remote_addr; /* Remote address */ | ||
| ucp_rkey_h rkey; /* Remote memory key */ | ||
|
|
||
| struct { | ||
| const uint64_t *remote_addrs; | ||
| ucp_rkey_h const *rkeys; | ||
| } sgl; | ||
| } rma; | ||
|
|
||
| struct { | ||
| const uint64_t *remote_addrs; | ||
| ucp_rkey_h const *rkeys; | ||
| } sgl; | ||
| } rma; | ||
| struct { | ||
| uint64_t remote_addr; /* Remote address */ | ||
| ucp_rkey_h rkey; /* Remote memory key */ | ||
| uint64_t value; /* Atomic argument */ | ||
| uint64_t result; /* Atomic result */ | ||
| void *reply_buffer; | ||
| uct_atomic_op_t uct_op; /* Requested UCT AMO */ | ||
| } amo; | ||
| }; | ||
| }; | ||
|
|
||
| struct { | ||
| /* Remote request ID received from a peer */ | ||
|
|
@@ -367,6 +395,8 @@ struct ucp_request { | |
| } rkey_ptr; | ||
|
|
||
| struct { | ||
| /* Fence epoch advanced by this flush */ | ||
| uint64_t fence_seq; | ||
| /* Snapshot of live lanes on the endpoint */ | ||
| ucp_lane_map_t all_lanes; | ||
| /* Which lanes flush has been started on */ | ||
|
|
@@ -411,15 +441,6 @@ struct ucp_request { | |
| ucp_rsc_index_t rsc_index; | ||
| } discard_uct_ep; | ||
|
|
||
| struct { | ||
| uint64_t remote_addr; /* Remote address */ | ||
| ucp_rkey_h rkey; /* Remote memory key */ | ||
| uint64_t value; /* Atomic argument */ | ||
| uint64_t result; /* Atomic result */ | ||
| void *reply_buffer; | ||
| uct_atomic_op_t uct_op; /* Requested UCT AMO */ | ||
| } amo; | ||
|
|
||
| struct { | ||
| ucs_queue_elem_t queue; /* Elem in outgoing ssend reqs queue */ | ||
| ucp_tag_t ssend_tag; /* Tag in offload sync send */ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor:
(status != UCS_OK) && UCS_STATUS_IS_ERR(status)is redundant sinceUCS_OK == 0can never satisfyUCS_STATUS_IS_ERR(). Suggestion: