1fi_rma(3)                      Libfabric v1.10.0                     fi_rma(3)
2
3
4

NAME

6       fi_rma - Remote memory access operations
7
8       fi_read / fi_readv / fi_readmsg
9              Initiates a read from remote memory
10
11       fi_write / fi_writev / fi_writemsg
12       fi_inject_write / fi_writedata : Initiate a write to remote memory
13

SYNOPSIS

15              #include <rdma/fi_rma.h>
16
17              ssize_t fi_read(struct fid_ep *ep, void *buf, size_t len, void *desc,
18                  fi_addr_t src_addr, uint64_t addr, uint64_t key, void *context);
19
20              ssize_t fi_readv(struct fid_ep *ep, const struct iovec *iov, void **desc,
21                  size_t count, fi_addr_t src_addr, uint64_t addr, uint64_t key,
22                  void *context);
23
24              ssize_t fi_readmsg(struct fid_ep *ep, const struct fi_msg_rma *msg,
25                  uint64_t flags);
26
27              ssize_t fi_write(struct fid_ep *ep, const void *buf, size_t len,
28                  void *desc, fi_addr_t dest_addr, uint64_t addr, uint64_t key,
29                  void *context);
30
31              ssize_t fi_writev(struct fid_ep *ep, const struct iovec *iov, void **desc,
32                  size_t count, fi_addr_t dest_addr, uint64_t addr, uint64_t key,
33                  void *context);
34
35              ssize_t fi_writemsg(struct fid_ep *ep, const struct fi_msg_rma *msg,
36                  uint64_t flags);
37
38              ssize_t fi_inject_write(struct fid_ep *ep, const void *buf, size_t len,
39                  fi_addr_t dest_addr, uint64_t addr, uint64_t key);
40
41              ssize_t fi_writedata(struct fid_ep *ep, const void *buf, size_t len,
42                  void *desc, uint64_t data, fi_addr_t dest_addr, uint64_t addr,
43                  uint64_t key, void *context);
44
45              ssize_t fi_inject_writedata(struct fid_ep *ep, const void *buf, size_t len,
46                  uint64_t data, fi_addr_t dest_addr, uint64_t addr, uint64_t key);
47

ARGUMENTS

49       ep     Fabric endpoint on which to initiate read or write operation.
50
51       buf    Local  data  buffer  to  read  into  (read target) or write from
52              (write source)
53
54       len    Length of data to read or  write,  specified  in  bytes.   Valid
55              transfers are from 0 bytes up to the endpoint's max_msg_size.
56
57       iov    Vectored data buffer.
58
59       count  Count of vectored data entries.
60
61       addr   Address  of  remote  memory to access.  This will be the virtual
62              address of the remote region in the case of FI_MR_BASIC, or  the
63              offset from the starting address in the case of FI_MR_SCALABLE.
64
65       key    Protection key associated with the remote memory.
66
67       desc   Descriptor associated with the local data buffer See fi_mr(3).
68
69       data   Remote CQ data to transfer with the operation.
70
71       dest_addr
72              Destination address for connectionless write transfers.  Ignored
73              for connected endpoints.
74
75       src_addr
76              Source address to read from for connectionless  transfers.   Ig‐
77              nored for connected endpoints.
78
79       msg    Message descriptor for read and write operations.
80
81       flags  Additional flags to apply for the read or write operation.
82
83       context
84              User  specified  pointer  to associate with the operation.  This
85              parameter is ignored if the operation will not generate  a  suc‐
86              cessful  completion, unless an op flag specifies the context pa‐
87              rameter be used for required input.
88

DESCRIPTION

90       RMA (remote memory access) operations are used to transfer data direct‐
91       ly between a local data buffer and a remote data buffer.  RMA transfers
92       occur on a byte level granularity, and no message boundaries are  main‐
93       tained.
94
95       The   write  functions  --  fi_write,  fi_writev,  fi_writemsg,  fi_in‐
96       ject_write, and fi_writedata -- are used to transmit data into a remote
97       memory  buffer.   The  main  difference between write functions are the
98       number and type of parameters that they accept  as  input.   Otherwise,
99       they perform the same general function.
100
101       The  read functions -- fi_read, fi_readv, and fi_readmsg -- are used to
102       transfer data from a remote memory region into  local  data  buffer(s).
103       Similar  to the write operations, read operations operate asynchronous‐
104       ly.  Users should not touch the posted data buffer(s)  until  the  read
105       operation has completed.
106
107       Completed  RMA  operations are reported to the user through one or more
108       completion queues associated with the endpoint.  Users provide  context
109       which  are  associated with each operation, and is returned to the user
110       as part of the completion.  See fi_cq for completion event details.
111
112       By default, the remote endpoint does not generate an  event  or  notify
113       the user when a memory region has been accessed by an RMA read or write
114       operation.  However, immediate data may be associated with an RMA write
115       operation.   RMA  writes with immediate data will generate a completion
116       entry at the remote endpoint, so that the immediate data may be  deliv‐
117       ered.
118
119   fi_write
120       The  call  fi_write  transfers the data contained in the user-specified
121       data buffer to a remote memory region.  The local endpoint must be con‐
122       nected  to  a remote endpoint or destination before fi_write is called.
123       Unless the endpoint has been configured differently,  the  data  buffer
124       passed  into  fi_write must not be touched by the application until the
125       fi_write call completes asynchronously.
126
127   fi_writev
128       The fi_writev call adds support for a scatter-gather list to  fi_write.
129       The  fi_writev  transfers the set of data buffers referenced by the iov
130       parameter to the remote memory region.
131
132   fi_writemsg
133       The fi_writemsg call supports data transfers over  both  connected  and
134       unconnected  endpoints, with the ability to control the write operation
135       per call through the use of flags.  The fi_writemsg  function  takes  a
136       struct fi_msg_rma as input.
137
138              struct fi_msg_rma {
139                  const struct iovec *msg_iov;     /* local scatter-gather array */
140                  void               **desc;       /* operation descriptor */
141                  size_t             iov_count;    /* # elements in msg_iov */
142                  fi_addr_t          addr;        /* optional endpoint address */
143                  const struct fi_rma_iov *rma_iov;/* remote SGL */
144                  size_t             rma_iov_count;/* # elements in rma_iov */
145                  void               *context;     /* user-defined context */
146                  uint64_t           data;         /* optional immediate data */
147              };
148
149              struct fi_rma_iov {
150                  uint64_t           addr;         /* target RMA address */
151                  size_t             len;          /* size of target buffer */
152                  uint64_t           key;          /* access key */
153              };
154
155   fi_inject_write
156       The write inject call is an optimized version of fi_write.  It provides
157       similar completion semantics as fi_inject fi_msg(3).
158
159   fi_writedata
160       The write data call is similar to fi_write, but allows for the  sending
161       of remote CQ data (see FI_REMOTE_CQ_DATA flag) as part of the transfer.
162
163   fi_inject_writedata
164       The  inject  write  data call is similar to fi_inject_write, but allows
165       for the sending of remote CQ data (see FI_REMOTE_CQ_DATA flag) as  part
166       of the transfer.
167
168   fi_read
169       The  fi_read  call requests that the remote endpoint transfer data from
170       the remote memory region into the local data buffer.   The  local  end‐
171       point  must  be  connected  to  a remote endpoint or destination before
172       fi_read is called.
173
174   fi_readv
175       The fi_readv call adds support for a scatter-gather  list  to  fi_read.
176       The  fi_readv transfers data from the remote memory region into the set
177       of data buffers referenced by the iov parameter.
178
179   fi_readmsg
180       The fi_readmsg call supports data transfers over both connected and un‐
181       connected endpoints, with the ability to control the read operation per
182       call through the use of flags.  The fi_readmsg function takes a  struct
183       fi_msg_rma as input.
184

FLAGS

186       The  fi_readmsg  and  fi_writemsg calls allow the user to specify flags
187       which can change the default data transfer operation.  Flags  specified
188       with fi_readmsg / fi_writemsg override most flags previously configured
189       with the endpoint, except where noted (see fi_endpoint.3).  The follow‐
190       ing list of flags are usable with fi_readmsg and/or fi_writemsg.
191
192       FI_REMOTE_CQ_DATA
193              Applies  to fi_writemsg and fi_writedata.  Indicates that remote
194              CQ data is available and should be sent as part of the  request.
195              See fi_getinfo for additional details on FI_REMOTE_CQ_DATA.
196
197       FI_COMPLETION
198              Indicates  that  a  completion entry should be generated for the
199              specified operation.  The endpoint must be bound to a completion
200              queue with FI_SELECTIVE_COMPLETION that corresponds to the spec‐
201              ified operation, or this flag is ignored.
202
203       FI_MORE
204              Indicates that the user has additional requests that will  imme‐
205              diately  be  posted after the current call returns.  Use of this
206              flag may improve performance by enabling the provider  to  opti‐
207              mize its access to the fabric hardware.
208
209       FI_INJECT
210              Applies to fi_writemsg.  Indicates that the outbound data buffer
211              should be returned to user immediately after the write call  re‐
212              turns,  even  if  the operation is handled asynchronously.  This
213              may require that the underlying provider implementation copy the
214              data  into a local buffer and transfer out of that buffer.  This
215              flag can only be used with messages smaller than inject_size.
216
217       FI_INJECT_COMPLETE
218              Applies to fi_writemsg.  Indicates that a completion  should  be
219              generated when the source buffer(s) may be reused.
220
221       FI_TRANSMIT_COMPLETE
222              Applies  to fi_writemsg.  Indicates that a completion should not
223              be generated until the operation has been successfully transmit‐
224              ted and is no longer being tracked by the provider.
225
226       FI_DELIVERY_COMPLETE
227              Applies  to  fi_writemsg.  Indicates that a completion should be
228              generated when the operation has been processed by the  destina‐
229              tion.
230
231       FI_COMMIT_COMPLETE
232              Applies to fi_writemsg when targeting persistent memory regions.
233              Indicates that a completion should be generated only  after  the
234              result of the operation has been made durable.
235
236       FI_FENCE
237              Applies  to  transmits.  Indicates that the requested operation,
238              also known as the fenced operation, and any operation posted af‐
239              ter the fenced operation will be deferred until all previous op‐
240              erations targeting the same peer endpoint have completed.  Oper‐
241              ations  posted after the fencing will see and/or replace the re‐
242              sults of any operations initiated prior to the fenced operation.
243
244       The ordering of operations starting at the posting of the fenced opera‐
245       tion  (inclusive)  to the posting of a subsequent fenced operation (ex‐
246       clusive) is controlled by the endpoint's ordering semantics.
247

RETURN VALUE

249       Returns 0 on success.  On error, a negative value corresponding to fab‐
250       ric  errno is returned.  Fabric errno values are defined in rdma/fi_er‐
251       rno.h.
252

ERRORS

254       -FI_EAGAIN
255              See fi_msg(3) for a detailed description of handling FI_EAGAIN.
256

SEE ALSO

258       fi_getinfo(3), fi_endpoint(3), fi_domain(3), fi_cq(3)
259

AUTHORS

261       OpenFabrics.
262
263
264
265Libfabric Programmer's Manual     2019-09-27                         fi_rma(3)
Impressum