UCX++
Public Member Functions | Friends | List of all members
ucxpp::worker Class Reference

Abstraction for a UCX worker. More...

#include <ucxpp/worker.h>

Inheritance diagram for ucxpp::worker:
Inheritance graph
[legend]
Collaboration diagram for ucxpp::worker:
Collaboration graph
[legend]

Public Member Functions

 worker (std::shared_ptr< context > ctx)
 Construct a new worker object. More...
 
int event_fd () const
 Get the event fd for the worker. The wakeup feature must be enabled for this to work. More...
 
std::shared_ptr< contextcontext_ptr () const
 Get the worker's context object. More...
 
local_address get_address () const
 Get the worker's UCX address. More...
 
ucp_worker_h handle () const
 Get the worker's native UCX handle. More...
 
bool progress () const
 Progress the worker. More...
 
void wait () const
 Wait for an event on the worker. It should be called only after a call to progress() returns false.
 
bool arm () const
 Arm the worker for next event notification. More...
 
tag_recv_awaitable tag_recv (void *buffer, size_t length, ucp_tag_t tag, ucp_tag_t tag_mask=0xFFFFFFFFFFFFFFFF) const
 Tag receive to the buffer. More...
 
void fence ()
 Fence the worker. Operations issued on the worker before the fence are ensured to complete before operations issued after the fence.
 
worker_flush_awaitable flush ()
 Flush the worker. More...
 

Friends

class local_address
 
class endpoint
 

Detailed Description

Abstraction for a UCX worker.

Constructor & Destructor Documentation

◆ worker()

ucxpp::worker::worker ( std::shared_ptr< context ctx)

Construct a new worker object.

Parameters
ctxUCX context

Member Function Documentation

◆ arm()

bool ucxpp::worker::arm ( ) const

Arm the worker for next event notification.

Returns
true If the worker was armed
false If the worker has pending events. In this case, the user must call progress() until it returns false.

◆ context_ptr()

std::shared_ptr< context > ucxpp::worker::context_ptr ( ) const

Get the worker's context object.

Returns
std::shared_ptr<context> The worker's context object

◆ event_fd()

int ucxpp::worker::event_fd ( ) const

Get the event fd for the worker. The wakeup feature must be enabled for this to work.

Returns
int

◆ flush()

worker_flush_awaitable ucxpp::worker::flush ( )

Flush the worker.

Returns
worker_flush_awaitable A coroutine that returns when the worker is flushed

◆ get_address()

local_address ucxpp::worker::get_address ( ) const

Get the worker's UCX address.

Returns
local_address The worker's UCX address

◆ handle()

ucp_worker_h ucxpp::worker::handle ( ) const

Get the worker's native UCX handle.

Returns
ucp_worker_h The worker's native UCX handle

◆ progress()

bool ucxpp::worker::progress ( ) const

Progress the worker.

Returns
true If progress was made
false If no progress was made

◆ tag_recv()

tag_recv_awaitable ucxpp::worker::tag_recv ( void *  buffer,
size_t  length,
ucp_tag_t  tag,
ucp_tag_t  tag_mask = 0xFFFFFFFFFFFFFFFF 
) const

Tag receive to the buffer.

Parameters
bufferThe buffer to receive to
lengthThe length of the buffer
tagThe tag to receive with
tag_maskThe bit mask for tag matching, 0 means accepting any tag
Returns
tag_recv_awaitable A coroutine that returns a pair of number of bytes received and the sender tag upon completion

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