fi_rma(3) | #VERSION# | fi_rma(3) |
fi_rma - Remote memory access operations
fi_write / fi_writev / fi_writemsg fi_inject_write / fi_writedata : Initiate a write to remote memory
#include <rdma/fi_rma.h> ssize_t fi_read(struct fid_ep *ep, void *buf, size_t len, void *desc,
fi_addr_t src_addr, uint64_t addr, uint64_t key, void *context); ssize_t fi_readv(struct fid_ep *ep, const struct iovec *iov, void **desc,
size_t count, fi_addr_t src_addr, uint64_t addr, uint64_t key,
void *context); ssize_t fi_readmsg(struct fid_ep *ep, const struct fi_msg_rma *msg,
uint64_t flags); ssize_t fi_write(struct fid_ep *ep, const void *buf, size_t len,
void *desc, fi_addr_t dest_addr, uint64_t addr, uint64_t key,
void *context); ssize_t fi_writev(struct fid_ep *ep, const struct iovec *iov, void **desc,
size_t count, fi_addr_t dest_addr, uint64_t addr, uint64_t key,
void *context); ssize_t fi_writemsg(struct fid_ep *ep, const struct fi_msg_rma *msg,
uint64_t flags); ssize_t fi_inject_write(struct fid_ep *ep, const void *buf, size_t len,
fi_addr_t dest_addr, uint64_t addr, uint64_t key); ssize_t fi_writedata(struct fid_ep *ep, const void *buf, size_t len,
void *desc, uint64_t data, fi_addr_t dest_addr, uint64_t addr,
uint64_t key, void *context); ssize_t fi_inject_writedata(struct fid_ep *ep, const void *buf, size_t len,
uint64_t data, fi_addr_t dest_addr, uint64_t addr, uint64_t key);
RMA (remote memory access) operations are used to transfer data directly between a local data buffer and a remote data buffer. RMA transfers occur on a byte level granularity, and no message boundaries are maintained.
The write functions – fi_write, fi_writev, fi_writemsg, fi_inject_write, and fi_writedata – are used to transmit data into a remote memory buffer. The main difference between write functions are the number and type of parameters that they accept as input. Otherwise, they perform the same general function.
The read functions – fi_read, fi_readv, and fi_readmsg – are used to transfer data from a remote memory region into local data buffer(s). Similar to the write operations, read operations operate asynchronously. Users should not touch the posted data buffer(s) until the read operation has completed.
Completed RMA operations are reported to the user through one or more completion queues associated with the endpoint. Users provide context which are associated with each operation, and is returned to the user as part of the completion. See fi_cq for completion event details.
By default, the remote endpoint does not generate an event or notify the user when a memory region has been accessed by an RMA read or write operation. However, immediate data may be associated with an RMA write operation. RMA writes with immediate data will generate a completion entry at the remote endpoint, so that the immediate data may be delivered.
The call fi_write transfers the data contained in the user-specified data buffer to a remote memory region.
The fi_writev call adds support for a scatter-gather list to fi_write. The fi_writev transfers the set of data buffers referenced by the iov parameter to the remote memory region.
The fi_writemsg call supports data transfers over both connected and connectionless endpoints, with the ability to control the write operation per call through the use of flags. The fi_writemsg function takes a struct fi_msg_rma as input.
struct fi_msg_rma {
const struct iovec *msg_iov; /* local scatter-gather array */
void **desc; /* operation descriptor */
size_t iov_count; /* # elements in msg_iov */
fi_addr_t addr; /* optional endpoint address */
const struct fi_rma_iov *rma_iov;/* remote SGL */
size_t rma_iov_count;/* # elements in rma_iov */
void *context; /* user-defined context */
uint64_t data; /* optional immediate data */ }; struct fi_rma_iov {
uint64_t addr; /* target RMA address */
size_t len; /* size of target buffer */
uint64_t key; /* access key */ };
The write inject call is an optimized version of fi_write. It provides similar completion semantics as fi_inject fi_msg(3).
The write data call is similar to fi_write, but allows for the sending of remote CQ data (see FI_REMOTE_CQ_DATA flag) as part of the transfer.
The inject write data call is similar to fi_inject_write, but allows for the sending of remote CQ data (see FI_REMOTE_CQ_DATA flag) as part of the transfer.
The fi_read call requests that the remote endpoint transfer data from the remote memory region into the local data buffer.
The fi_readv call adds support for a scatter-gather list to fi_read. The fi_readv transfers data from the remote memory region into the set of data buffers referenced by the iov parameter.
The fi_readmsg call supports data transfers over both connected and connectionless endpoints, with the ability to control the read operation per call through the use of flags. The fi_readmsg function takes a struct fi_msg_rma as input.
The fi_readmsg and fi_writemsg calls allow the user to specify flags which can change the default data transfer operation. Flags specified with fi_readmsg / fi_writemsg override most flags previously configured with the endpoint, except where noted (see fi_endpoint.3). The following list of flags are usable with fi_readmsg and/or fi_writemsg.
The ordering of operations starting at the posting of the fenced operation (inclusive) to the posting of a subsequent fenced operation (exclusive) is controlled by the endpoint’s ordering semantics.
Returns 0 on success. On error, a negative value corresponding to fabric errno is returned. Fabric errno values are defined in rdma/fi_errno.h.
OpenFabrics.
2022-12-11 | Libfabric Programmer’s Manual |