1 #ifndef VERBS_HELPER_HPP 2 #define VERBS_HELPER_HPP 25 class invalid_args :
public exception {};
26 class connection_broken :
public exception {};
27 class creation_failure :
public exception {};
28 class mr_creation_failure :
public creation_failure {};
29 class cq_creation_failure :
public creation_failure {};
41 std::unique_ptr<ibv_mr, std::function<void(ibv_mr*)>>
mr;
42 std::unique_ptr<char[]> allocated_buffer;
51 uint32_t get_rkey()
const;
61 : buffer(remote_address), size(length),
rkey(remote_key) {}
63 const uint64_t buffer;
69 std::unique_ptr<ibv_cq, std::function<void(ibv_cq*)>>
cq;
77 typedef std::function<void(uint64_t tag, uint32_t immediate, size_t length)>
83 static constexpr
unsigned int shift_bits = 64 - 8 *
sizeof(tag_type);
86 std::optional<tag_type>
tag;
93 message_type(
const std::string& name, completion_handler send_handler,
94 completion_handler recv_handler,
95 completion_handler write_handler =
nullptr);
108 std::unique_ptr<ibv_qp, std::function<void(ibv_qp*)>>
qp;
119 bool post_send(
const memory_region& mr,
size_t offset,
size_t length,
120 uint64_t wr_id, uint32_t immediate,
122 bool post_recv(
const memory_region& mr,
size_t offset,
size_t length,
125 bool post_empty_send(uint64_t wr_id, uint32_t immediate,
127 bool post_empty_recv(uint64_t wr_id,
const message_type& type);
129 bool post_write(
const memory_region& mr,
size_t offset,
size_t length,
132 bool signaled =
false,
bool send_inline =
false);
150 std::unique_ptr<task_impl> impl;
151 std::shared_ptr<manager_queue_pair>
mqp;
154 task(std::shared_ptr<manager_queue_pair> manager_qp);
161 size_t offset,
size_t length, uint32_t immediate);
163 size_t offset,
size_t length);
174 bool verbs_initialize(
const std::map<uint32_t, std::string>& node_addresses,
188 const std::vector<uint32_t>& members, uint32_t
node_rank,
std::unique_ptr< ibv_mr, std::function< void(ibv_mr *)> > mr
partial_wrapped< Tag, Ret, NewClass, Args... > tag(Ret(NewClass::*fun)(Args...))
User-facing entry point for the series of functions that binds a FunctionTag to a class's member func...
std::function< void(uint64_t tag, uint32_t immediate, size_t length)> completion_handler
std::map< uint32_t, remote_memory_region > verbs_exchange_memory_regions(const std::vector< uint32_t > &members, uint32_t node_rank, const memory_region &mr)
bool verbs_add_connection(uint32_t index, const std::string &address, uint32_t node_rank)
struct rdma::completion_handler_set __attribute__
A C++ wrapper for the libfabric fid_cq struct and its associated functions.
A C++ wrapper for the IB Verbs ibv_qp struct and its associated functions.
Contains functions and classes for low-level RDMA operations, such as setting up memory regions and q...
bool verbs_initialize(const std::map< uint32_t, std::string > &node_addresses, uint32_t node_rank)
std::shared_ptr< manager_queue_pair > mqp
remote_memory_region(uint64_t remote_address, size_t length, uint32_t remote_key)
bool set_contiguous_memory_mode(bool enabled)
std::unique_ptr< ibv_cq, std::function< void(ibv_cq *)> > cq
bool set_interrupt_mode(bool enabled)
feature_set get_supported_features()
bool verbs_remove_connection(uint32_t index)
std::unique_ptr< ibv_qp, std::function< void(ibv_qp *)> > qp