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

Abstraction for a UCX endpoint. More...

#include <ucxpp/endpoint.h>

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

Public Member Functions

 endpoint (std::shared_ptr< worker > worker, remote_address const &peer)
 Construct a new endpoint object. More...
 
std::shared_ptr< workerworker_ptr () const
 Get the worker object. More...
 
void print () const
 Print the endpoint's information.
 
ucp_ep_h handle () const
 Get the endpoint's native UCX handle. More...
 
const remote_addressget_address () const
 Get the endpoint's remote address. More...
 
stream_send_awaitable stream_send (void const *buffer, size_t length) const
 Stream send the buffer. More...
 
stream_recv_awaitable stream_recv (void *buffer, size_t length) const
 Stream receive to the buffer. More...
 
tag_send_awaitable tag_send (void const *buffer, size_t length, ucp_tag_t tag) const
 Tag send the buffer. More...
 
ep_flush_awaitable flush () const
 Flush the endpoint. More...
 
task< void > close ()
 Close the endpoint. You should not use the endpoint after calling this function. More...
 
 ~endpoint ()
 Destroy the endpoint object. If the endpoint is not closed yet, it will be closed.
 
- Public Member Functions inherited from ucxpp::noncopyable
 noncopyable (noncopyable &&)=default
 
 noncopyable (noncopyable const &)=delete
 
noncopyableoperator= (noncopyable const &)=delete
 
noncopyableoperator= (noncopyable &&)=default
 

Static Public Member Functions

static void error_cb (void *ep, ucp_ep_h ep_h, ucs_status_t status)
 Error handler for all endpoints. More...
 
static void close_cb (void *request, ucs_status_t status, void *user_data)
 Endpoint close callback. More...
 

Friends

class worker
 
class local_memory_handle
 
class remote_memory_handle
 
class ep_close_awaitable
 

Detailed Description

Abstraction for a UCX endpoint.

Constructor & Destructor Documentation

◆ endpoint()

ucxpp::endpoint::endpoint ( std::shared_ptr< worker worker,
remote_address const &  peer 
)

Construct a new endpoint object.

Parameters
workerUCX worker
peerRemote UCX address

Member Function Documentation

◆ close()

task< void > ucxpp::endpoint::close ( )

Close the endpoint. You should not use the endpoint after calling this function.

Returns
task<void> A coroutine that returns upon completion

◆ close_cb()

void ucxpp::endpoint::close_cb ( void *  request,
ucs_status_t  status,
void *  user_data 
)
static

Endpoint close callback.

Parameters
requestUCX request handle
statusUCX status
user_dataUser data

◆ error_cb()

void ucxpp::endpoint::error_cb ( void *  ep,
ucp_ep_h  ep_h,
ucs_status_t  status 
)
static

Error handler for all endpoints.

Parameters
ependpoint object
ep_hUCX endpoint handle
statuserror status

◆ flush()

ep_flush_awaitable ucxpp::endpoint::flush ( ) const

Flush the endpoint.

Returns
ep_flush_awaitable A coroutine that returns upon completion

◆ get_address()

const remote_address & ucxpp::endpoint::get_address ( ) const

Get the endpoint's remote address.

Returns
remote_address The endpoint's remote address

◆ handle()

ucp_ep_h ucxpp::endpoint::handle ( ) const

Get the endpoint's native UCX handle.

Returns
ucp_ep_h The endpoint's native UCX handle

◆ stream_recv()

stream_recv_awaitable ucxpp::endpoint::stream_recv ( void *  buffer,
size_t  length 
) const

Stream receive to the buffer.

Parameters
bufferThe buffer to receive to
lengthThe length of the buffer
Returns
stream_recv_awaitable A coroutine that returns number of bytes received upon completion

◆ stream_send()

stream_send_awaitable ucxpp::endpoint::stream_send ( void const *  buffer,
size_t  length 
) const

Stream send the buffer.

Parameters
bufferThe buffer to send
lengthThe length of the buffer
Returns
stream_send_awaitable A coroutine that returns upon completion

◆ tag_send()

tag_send_awaitable ucxpp::endpoint::tag_send ( void const *  buffer,
size_t  length,
ucp_tag_t  tag 
) const

Tag send the buffer.

Parameters
bufferThe buffer to send
lengthThe length of the buffer
tagThe tag to send with
Returns
tag_send_awaitable A coroutine that returns upon completion

◆ worker_ptr()

std::shared_ptr< worker > ucxpp::endpoint::worker_ptr ( ) const

Get the worker object.

Returns
std::shared_ptr<worker> The endpoint's worker

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