A C++ wrapper for the libfabric fid_ep struct and its associated functions. More...
#include <lf_helper.hpp>
Public Member Functions | |
virtual | ~endpoint () |
endpoint (size_t remote_index, bool is_lf_server) | |
Constructor Calls the second constructor with an empty lambda as the second argument. More... | |
endpoint (size_t remote_index, bool is_lf_server, std::function< void(endpoint *)> post_recvs) | |
Constructor Initializes members and then calls endpoint::connect. More... | |
endpoint (endpoint &&)=default | |
Constructor Default move constructor. More... | |
int | init (struct fi_info *fi) |
init Creates an endpoint, and then initializes/enables it More... | |
void | connect (size_t remote_index, bool is_lf_server, std::function< void(endpoint *)> post_recvs) |
connect Uses the initialized endpoint to connect to a remote node More... | |
bool | post_send (const memory_region &mr, size_t offset, size_t size, uint64_t wr_id, uint32_t immediate, const message_type &type) |
post_send Uses the libfabrics API to post a buffer to an endpoint. More... | |
bool | post_recv (const memory_region &mr, size_t offset, size_t size, uint64_t wr_id, const message_type &type) |
post_recv Uses the libfabrics API to post a buffer to the recv queue of an endpoint. More... | |
bool | post_empty_send (uint64_t wr_id, uint32_t immediate, const message_type &type) |
bool | post_empty_recv (uint64_t wr_id, const message_type &type) |
bool | post_write (const memory_region &mr, size_t offset, size_t size, uint64_t wr_id, remote_memory_region remote_mr, size_t remote_offset, const message_type &type, bool signaled=false, bool send_inline=false) |
Public Attributes | |
fi_addr_t | remote_fi_addr |
Protected Member Functions | |
endpoint () | |
Protected Attributes | |
std::unique_ptr< fid_eq, std::function< void(fid_eq *)> > | eq |
Smart pointer for managing the endpoint. More... | |
std::unique_ptr< fid_ep, std::function< void(fid_ep *)> > | ep |
Friends | |
class | task |
A C++ wrapper for the libfabric fid_ep struct and its associated functions.
Definition at line 157 of file lf_helper.hpp.
|
inlineexplicitprotected |
Definition at line 163 of file lf_helper.hpp.
|
virtual |
Definition at line 245 of file lf_helper.cpp.
|
explicit |
Constructor Calls the second constructor with an empty lambda as the second argument.
remote_index | The id of the remote node. |
Definition at line 246 of file lf_helper.cpp.
rdma::endpoint::endpoint | ( | size_t | remote_index, |
bool | is_lf_server, | ||
std::function< void(endpoint *)> | post_recvs | ||
) |
Constructor Initializes members and then calls endpoint::connect.
remote_index | The index of the remote node in the group. |
is_lf_server | This parameter decide local role in connection. If is_lf_server is true, it waits on PEP for connection from remote side. Otherwise, it initiate a connection to remote side. |
post_recvs | A lambda that is called at the end of initializing the endpoints on the client and remote sides to avoid race conditions between post_send() and post_recv(). |
Definition at line 248 of file lf_helper.cpp.
|
default |
Constructor Default move constructor.
void rdma::endpoint::connect | ( | size_t | remote_index, |
bool | is_lf_server, | ||
std::function< void(endpoint *)> | post_recvs | ||
) |
connect Uses the initialized endpoint to connect to a remote node
remote_index | The index of the remote node in the group. |
is_lf_server | This parameter decide local role in connection. If is_lf_server is true, it waits on PEP for connection from remote side. Otherwise, it initiate a connection to remote side. |
post_recvs | A lambda that is called at the end of initializing the endpoints on the client and remote sides to avoid race conditions between post_send() and post_recv(). |
Populate local cm struct and exchange cm info
Connect to remote node
Synchronously read from the passive event queue, init the server ep
TODO document this
TODO document this
TODO document this
Definition at line 309 of file lf_helper.cpp.
int rdma::endpoint::init | ( | struct fi_info * | fi | ) |
init Creates an endpoint, and then initializes/enables it
fi | A struct containing information about the current fabric services. |
Open an endpoint
Construct the smart pointer to manage the endpoint
Create an event queue
Construct the smart pointer to manage the event queue
Bind endpoint to event queue and completion queue
Definition at line 253 of file lf_helper.cpp.
bool rdma::endpoint::post_empty_recv | ( | uint64_t | wr_id, |
const message_type & | type | ||
) |
Definition at line 456 of file lf_helper.cpp.
bool rdma::endpoint::post_empty_send | ( | uint64_t | wr_id, |
uint32_t | immediate, | ||
const message_type & | type | ||
) |
Definition at line 441 of file lf_helper.cpp.
bool rdma::endpoint::post_recv | ( | const memory_region & | mr, |
size_t | offset, | ||
size_t | size, | ||
uint64_t | wr_id, | ||
const message_type & | type | ||
) |
post_recv Uses the libfabrics API to post a buffer to the recv queue of an endpoint.
mr | The wrapper around the memory region that is being posted. |
offset | The offset into the buffer managed by mr. |
size | The size (in bytes) of the buffer. |
wr_id | A parameter used to differentiate types of messages. |
message_type |
Definition at line 420 of file lf_helper.cpp.
bool rdma::endpoint::post_send | ( | const memory_region & | mr, |
size_t | offset, | ||
size_t | size, | ||
uint64_t | wr_id, | ||
uint32_t | immediate, | ||
const message_type & | type | ||
) |
post_send Uses the libfabrics API to post a buffer to an endpoint.
mr | The wrapper around the memory region that is being sent. |
offset | The offset into the buffer managed by mr. |
size | The size (in bytes) of the buffer being sent. |
wr_id | A parameter used to differentiate types of messages. |
immediate | A parameter used only for send operations. |
message_type |
Definition at line 397 of file lf_helper.cpp.
bool rdma::endpoint::post_write | ( | const memory_region & | mr, |
size_t | offset, | ||
size_t | size, | ||
uint64_t | wr_id, | ||
remote_memory_region | remote_mr, | ||
size_t | remote_offset, | ||
const message_type & | type, | ||
bool | signaled = false , |
||
bool | send_inline = false |
||
) |
Definition at line 469 of file lf_helper.cpp.
|
friend |
Definition at line 165 of file lf_helper.hpp.
|
protected |
Definition at line 161 of file lf_helper.hpp.
|
protected |
Smart pointer for managing the endpoint.
Definition at line 160 of file lf_helper.hpp.
fi_addr_t rdma::endpoint::remote_fi_addr |
Definition at line 255 of file lf_helper.hpp.