Loading...
Searching...
No Matches
ucxx::RequestTagMulti Class Reference

Send or receive multiple messages with the UCX Tag API. More...

#include <request_tag_multi.h>

Inheritance diagram for ucxx::RequestTagMulti:
ucxx::Request ucxx::Component

Public Member Functions

virtual ~RequestTagMulti ()
 ucxx::RequestTagMulti destructor.
void markCompleted (ucs_status_t status)
 Mark request as completed.
void recvCallback (ucs_status_t status)
 Callback to submit request to receive new header or frames.
void cancel () override
 Cancel the request.
Public Member Functions inherited from ucxx::Request
 Request (const Request &)=delete
Request & operator= (Request const &)=delete
 Request (Request &&o)=delete
Request & operator= (Request &&o)=delete
virtual ~Request ()
 ucxx::Request destructor.
ucs_status_t getStatus ()
 Return the status of the request.
void * getFuture ()
 Return the future used to check on state.
void checkError ()
 Check whether the request completed with an error.
bool isCompleted ()
 Check whether the request has already completed.
void callback (void *request, ucs_status_t status)
 Callback executed by UCX when request is completed.
void populateDelayedSubmission ()
 Populate the internal submission dispatcher.
const std::string & getOwnerString () const
 Get formatted string with owner type and handle address.
virtual std::shared_ptr< Buffer > getRecvBuffer ()
 Get the received buffer.
virtual std::string getRecvHeader ()
 Get the received user header.
Attributes queryAttributes ()
 Get the requests's attributes.
Public Member Functions inherited from ucxx::Component
void setParent (std::shared_ptr< Component > parent)
 Set the internal parent reference.
std::shared_ptr< Component > getParent () const
 Get the internal parent reference.

Public Attributes

std::vector< BufferRequestPtr > _bufferRequests {}
 Container of all requests posted.
bool _isFilled {false}
 Whether the all requests have been posted.

Friends

class detail::ConstructorFactory

Additional Inherited Members

Protected Member Functions inherited from ucxx::Request
 Request (std::shared_ptr< Component > endpointOrWorker, const data::RequestData requestData, std::string operationName, const bool enablePythonFuture=false, RequestCallbackUserFunction callbackFunction=nullptr, RequestCallbackUserData callbackData=nullptr)
 Protected constructor of an abstract ucxx::Request.
void process ()
 Perform initial processing of the request to determine if immediate completion.
void setStatus (ucs_status_t status)
 Set the request status and notify Python future.
void publishRequest (void *request)
 Publish the UCP request handle and capture its attributes.
Protected Attributes inherited from ucxx::Request
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.
std::shared_ptr< Worker > _worker
 Worker that generated request (if not from endpoint).
std::shared_ptr< Endpoint > _endpoint
 Endpoint that generated request (if not from worker).
std::string _ownerString
 String to print owner (endpoint or worker) when logging.
std::recursive_mutex _mutex {}
 Mutex to prevent checking status while it's being set.
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.
bool _enablePythonFuture {true}
 Whether Python future is enabled for this request.
RequestCallbackUserFunction _callback {nullptr}
 Completion callback.
RequestCallbackUserData _callbackData {nullptr}
 Completion callback data.
Attributes _requestAttr {}
Protected Attributes inherited from ucxx::Component
std::shared_ptr< Component > _parent {nullptr}
 A reference-counted pointer to the parent.

Detailed Description

Send or receive multiple messages with the UCX Tag API.

Send or receive multiple messages with the UCX Tag API. This is done combining multiple messages with ucxx::RequestTag, first sending/receiving a header, followed by sending/receiving the user messages. Intended primarily for use with Python, such that the program can then only wait for the completion of one future and thus reduce potentially expensive iterations over multiple futures.

Constructor & Destructor Documentation

◆ ~RequestTagMulti()

virtual ucxx::RequestTagMulti::~RequestTagMulti ( )
virtual

ucxx::RequestTagMulti destructor.

Free internal resources.

Member Function Documentation

◆ cancel()

void ucxx::RequestTagMulti::cancel ( )
overridevirtual

Cancel the request.

Cancel the request. Often called by the error handler or parent's object destructor but may be called by the user to cancel the request as well.

Reimplemented from ucxx::Request.

◆ markCompleted()

void ucxx::RequestTagMulti::markCompleted ( ucs_status_t status)

Mark request as completed.

Mark a single ucxx::RequestTag as completed. This method is passed as the user-defined callback to the ucxx::RequestTag constructor, which will then be executed when that completes.

When this method is called, the request that completed will be pushed into a container which will be later used to evaluate if all tracked requests completed and set the final status of the multi-transfer request and the Python future, if enabled. The final status is either UCS_OK if all underlying requests completed successfully, otherwise it will contain the status of the first failing request, for granular information the user may still verify each of the underlying requests individually.

Parameters
[in]statusthe status of the request being completed.

◆ recvCallback()

void ucxx::RequestTagMulti::recvCallback ( ucs_status_t status)

Callback to submit request to receive new header or frames.

When a receive multi-transfer tag request is created or has received a new header, this callback must be executed to ensure the next request to receive is submitted.

If no requests for the present ucxx::RequestTagMulti transfer have been posted yet, create one receiving a message with header. If the previous received request is header containing the next flag set, then the next request is another header. Otherwise, the next incoming message(s) is(are) frame(s).

When called, the callback receives a single argument, the status of the current request.

Parameters
[in]statusthe status of the request being completed.
Exceptions
std::runtime_errorif called by a send request.

The documentation for this class was generated from the following file: