5#include <ucs/type/status.h>
6#include <unordered_map>
8#include <ucp/api/ucp.h>
10#include "ucxpp/address.h"
11#include "ucxpp/awaitable.h"
12#include "ucxpp/context.h"
20class worker :
public std::enable_shared_from_this<worker> {
24 std::shared_ptr<context> ctx_;
33 worker(std::shared_ptr<context> ctx);
62 ucp_worker_h
handle()
const;
99 ucp_tag_t tag_mask = 0xFFFFFFFFFFFFFFFF)
const;
Abstraction for a UCX endpoint.
Definition: endpoint.h:27
Represents a local UCX address.
Definition: address.h:19
Definition: awaitable.h:283
Definition: awaitable.h:208
Abstraction for a UCX worker.
Definition: worker.h:20
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.
Definition: worker.cc:66
std::shared_ptr< context > context_ptr() const
Get the worker's context object.
Definition: worker.cc:39
bool progress() const
Progress the worker.
Definition: worker.cc:51
void fence()
Fence the worker. Operations issued on the worker before the fence are ensured to complete before ope...
Definition: worker.cc:71
bool arm() const
Arm the worker for next event notification.
Definition: worker.cc:57
worker(std::shared_ptr< context > ctx)
Construct a new worker object.
Definition: worker.cc:22
local_address get_address() const
Get the worker's UCX address.
Definition: worker.cc:41
worker_flush_awaitable flush()
Flush the worker.
Definition: worker.cc:75
void wait() const
Wait for an event on the worker. It should be called only after a call to progress() returns false.
Definition: worker.cc:53
ucp_worker_h handle() const
Get the worker's native UCX handle.
Definition: worker.cc:49
int event_fd() const
Get the event fd for the worker. The wakeup feature must be enabled for this to work.
Definition: worker.cc:34