Send or receive a message with the UCX Tag API. More...
#include <request_tag.h>
Public Member Functions | |
virtual void | populateDelayedSubmission () |
Populate the internal submission dispatcher. More... | |
void | request () |
Create and submit a tag request. More... | |
void | callback (void *request, ucs_status_t status, const ucp_tag_recv_info_t *info) |
Implementation of the tag receive request callback. More... | |
![]() | |
Request (const Request &)=delete | |
Request & | operator= (Request const &)=delete |
Request (Request &&o)=delete | |
Request & | operator= (Request &&o)=delete |
virtual | ~Request () |
ucxx::Request destructor. More... | |
virtual void | cancel () |
Cancel the request. More... | |
ucs_status_t | getStatus () |
Return the status of the request. More... | |
void * | getFuture () |
Return the future used to check on state. More... | |
void | checkError () |
Check whether the request completed with an error. More... | |
bool | isCompleted () |
Check whether the request has already completed. More... | |
void | callback (void *request, ucs_status_t status) |
Callback executed by UCX when request is completed. More... | |
const std::string & | getOwnerString () const |
Get formatted string with owner type and handle address. More... | |
virtual std::shared_ptr< Buffer > | getRecvBuffer () |
Get the received buffer. More... | |
![]() | |
void | setParent (std::shared_ptr< Component > parent) |
Set the internal parent reference. More... | |
std::shared_ptr< Component > | getParent () const |
Get the internal parent reference. More... | |
Static Public Member Functions | |
static void | tagSendCallback (void *request, ucs_status_t status, void *arg) |
Callback executed by UCX when a tag send request is completed. More... | |
static void | tagRecvCallback (void *request, ucs_status_t status, const ucp_tag_recv_info_t *info, void *arg) |
Callback executed by UCX when a tag receive request is completed. More... | |
Friends | |
std::shared_ptr< RequestTag > | createRequestTag (std::shared_ptr< Component > endpointOrWorker, const std::variant< data::TagSend, data::TagReceive > requestData, const bool enablePythonFuture, RequestCallbackUserFunction callbackFunction, RequestCallbackUserData callbackData) |
Constructor for std::shared_ptr<ucxx::RequestTag> . More... | |
Additional Inherited Members | |
![]() | |
Request (std::shared_ptr< Component > endpointOrWorker, const data::RequestData requestData, const std::string operationName, const bool enablePythonFuture=false, RequestCallbackUserFunction callbackFunction=nullptr, RequestCallbackUserData callbackData=nullptr) | |
Protected constructor of an abstract ucxx::Request . More... | |
void | process () |
Perform initial processing of the request to determine if immediate completion. More... | |
void | setStatus (ucs_status_t status) |
Set the request status and notify Python future. More... | |
![]() | |
ucs_status_t | _status {UCS_INPROGRESS} |
Requests status. | |
std::string | _status_msg {} |
Human-readable status message. | |
void * | _request {nullptr} |
Pointer to UCP request. | |
std::shared_ptr< Future > | _future {nullptr} |
Future to notify upon completion. | |
RequestCallbackUserFunction | _callback {nullptr} |
Completion callback. | |
RequestCallbackUserData | _callbackData {nullptr} |
Completion callback data. | |
std::shared_ptr< Worker > | _worker |
Worker that generated request (if not from endpoint) More... | |
std::shared_ptr< Endpoint > | _endpoint |
Endpoint that generated request (if not from worker) More... | |
std::string | _ownerString |
String to print owner (endpoint or worker) when logging. More... | |
data::RequestData | _requestData {} |
The operation-specific data to be used in the request. | |
std::string | _operationName |
Human-readable operation name, mostly used for log messages. More... | |
std::recursive_mutex | _mutex {} |
Mutex to prevent checking status while it's being set. | |
bool | _enablePythonFuture {true} |
Whether Python future is enabled for this request. | |
![]() | |
std::shared_ptr< Component > | _parent {nullptr} |
A reference-counted pointer to the parent. | |
Send or receive a message with the UCX Tag API.
Send or receive a message with the UCX Tag API, using non-blocking UCP calls ucp_tag_send_nbx
or ucp_tag_recv_nbx
.
void ucxx::RequestTag::callback | ( | void * | request, |
ucs_status_t | status, | ||
const ucp_tag_recv_info_t * | info | ||
) |
Implementation of the tag receive request callback.
Implementation of the tag receive request callback. Verify whether the message was truncated and set that state if necessary, and finally dispatch ucxx::Request::callback()
.
WARNING: This is not intended to be called by the user, but it currently needs to be a public method so that UCX may access it. In future changes this will be moved to an internal object and remove this method from the public API.
[in] | request | the UCX request pointer. |
[in] | status | the completion status of the request. |
[in] | info | information of the completed transfer provided by UCX, includes length of message received used to verify for truncation. |
|
virtual |
Populate the internal submission dispatcher.
The ucxx::Request
utilizes ucxx::DelayedSubmission
to manage when the request will be dispatched. This method is registered as a callback in the worker, that may choose to either execute (submit) it immediately or delay for the next iteration of its progress loop, depending on the progress mode in use by the worker.
See ucxx::DelayedSubmission::DelayedSubmission()
for more details.
Implements ucxx::Request.
void ucxx::RequestTag::request | ( | ) |
Create and submit a tag request.
This is the method that should be called to actually submit a tag request. It is meant to be called from populateDelayedSubmission()
, which is decided at the discretion of std::shared_ptr<ucxx::Worker>
. See populateDelayedSubmission()
for more details.
|
static |
Callback executed by UCX when a tag receive request is completed.
Callback executed by UCX when a tag receive request is completed, that will dispatch ucxx::RequestTag::callback()
.
WARNING: This is not intended to be called by the user, but it currently needs to be a public method so that UCX may access it. In future changes this will be moved to an internal object and remove this method from the public API.
[in] | request | the UCX request pointer. |
[in] | status | the completion status of the request. |
[in] | info | information of the completed transfer provided by UCX, includes length of message received used to verify for truncation. |
[in] | arg | the pointer to the ucxx::Request object that created the transfer, effectively this pointer as seen by request() . |
|
static |
Callback executed by UCX when a tag send request is completed.
Callback executed by UCX when a tag send request is completed, that will dispatch ucxx::Request::callback()
.
WARNING: This is not intended to be called by the user, but it currently needs to be a public method so that UCX may access it. In future changes this will be moved to an internal object and remove this method from the public API.
[in] | request | the UCX request pointer. |
[in] | status | the completion status of the request. |
[in] | arg | the pointer to the ucxx::Request object that created the transfer, effectively this pointer as seen by request() . |
|
friend |
Constructor for std::shared_ptr<ucxx::RequestTag>
.
The constructor for a std::shared_ptr<ucxx::RequestTag>
object, creating a send or receive tag request, returning a pointer to a request object that can be later awaited and checked for errors. This is a non-blocking operation, and the status of the transfer must be verified from the resulting request object before the data can be released (for a send operation) or consumed (for a receive operation).
ucxx::Error | if send is true and endpointOrWorker is not a std::shared_ptr<ucxx::Endpoint> . |
[in] | endpointOrWorker | the parent component, which may either be a std::shared_ptr<Endpoint> or std::shared_ptr<Worker> . |
[in] | requestData | container of the specified message type, including all type-specific data. |
[in] | enablePythonFuture | whether a python future should be created and subsequently notified. |
[in] | callbackFunction | user-defined callback function to call upon completion. |
[in] | callbackData | user-defined data to pass to the callbackFunction . |
shared_ptr<ucxx::RequestTag>
object