11 #include <rdma/fabric.h> 16 #define LF_VERSION FI_VERSION(1,5) 55 std::unique_ptr<fid_mr, std::function<void(fid_mr *)>>
mr;
86 uint64_t get_key()
const;
105 : buffer(remote_address), size(length),
rkey(remote_key) {}
117 std::unique_ptr<fid_cq, std::function<void(fid_cq *)>>
cq;
130 typedef std::function<void(uint64_t tag, uint32_t immediate, size_t length)>
136 static constexpr
unsigned int shift_bits = 64 - 8 *
sizeof(tag_type);
139 std::optional<tag_type>
tag;
160 std::unique_ptr<fid_eq, std::function<void(fid_eq *)>>
eq;
161 std::unique_ptr<fid_ep, std::function<void(fid_ep *)>>
ep;
175 explicit endpoint(
size_t remote_index,
bool is_lf_server);
188 endpoint(
size_t remote_index,
bool is_lf_server,
189 std::function<
void(
endpoint*)> post_recvs);
202 int init(
struct fi_info *fi);
215 void connect(
size_t remote_index,
bool is_lf_server,
216 std::function<
void(
endpoint *)> post_recvs);
230 size_t size, uint64_t wr_id, uint32_t immediate,
243 size_t size, uint64_t wr_id,
246 bool post_empty_send(uint64_t wr_id, uint32_t immediate,
248 bool post_empty_recv(uint64_t wr_id,
const message_type& type);
250 bool post_write(
const memory_region& mr,
size_t offset,
size_t size,
253 bool signaled =
false,
bool send_inline =
false);
275 std::unique_ptr<task_impl>
impl;
276 std::shared_ptr<manager_endpoint>
mep;
279 task(std::shared_ptr<manager_endpoint> manager_ep);
286 size_t offset,
size_t length, uint32_t immediate);
288 size_t offset,
size_t length);
293 bool lf_initialize(
const std::map<uint32_t, std::pair<ip_addr_t, uint16_t>>& ip_addrs_and_ports,
295 bool lf_add_connection(uint32_t new_id,
const std::pair<ip_addr_t, uint16_t> &new_ip_addr_and_port);
300 const std::vector<uint32_t>& members, uint32_t node_rank,
std::function< void(uint64_t tag, uint32_t immediate, size_t length)> completion_handler
remote_memory_region(uint64_t remote_address, size_t length, uint64_t remote_key)
Constructor Takes in parameters representing a remote memory region.
std::unique_ptr< fid_mr, std::function< void(fid_mr *)> > mr
Smart pointer for managing the registered memory region.
managed_endpoint(size_t remote_index, std::function< void(managed_endpoint *)> post_recvs)
TODO Implement the constructor.
std::unique_ptr< fid_cq, std::function< void(fid_cq *)> > cq
Smart pointer for managing the completion queue.
struct rdma::completion_handler_set __attribute__
A C++ wrapper for the libfabric fid_cq struct and its associated functions.
std::unique_ptr< fid_eq, std::function< void(fid_eq *)> > eq
Smart pointer for managing the endpoint.
Contains functions and classes for low-level RDMA operations, such as setting up memory regions and q...
bool lf_remove_connection(uint32_t node_id)
Removes a node's TCP connection, presumably because it has failed.
std::map< uint32_t, remote_memory_region > lf_exchange_memory_regions(const std::vector< uint32_t > &members, uint32_t node_rank, const memory_region &mr)
bool lf_add_connection(uint32_t new_id, const std::pair< ip_addr_t, uint16_t > &new_ip_addr_and_port)
Adds a node to the group via tcp.
A C++ wrapper for the libfabric fid_ep struct and its associated functions.
std::unique_ptr< task_impl > impl
std::unique_ptr< char[]> allocated_buffer
Smart pointer for managing the buffer the mr uses.
manager_endpoint()
TODO: Implement the constructor.
bool set_interrupt_mode(bool enabled)
std::optional< tag_type > tag
bool lf_initialize(const std::map< uint32_t, std::pair< ip_addr_t, uint16_t >> &ip_addrs_and_ports, uint32_t node_rank)
Initialize the global context.
std::unique_ptr< fid_ep, std::function< void(fid_ep *)> > ep
std::shared_ptr< manager_endpoint > mep