22 #ifndef MCA_PML_OB1_HEADER_H
23 #define MCA_PML_OB1_HEADER_H
25 #include "ompi_config.h"
26 #ifdef HAVE_SYS_TYPES_H
27 #include <sys/types.h>
29 #ifdef HAVE_NETINET_IN_H
30 #include <netinet/in.h>
33 #include "opal/types.h"
34 #include "opal/util/arch.h"
38 #define MCA_PML_OB1_HDR_TYPE_MATCH (MCA_BTL_TAG_PML + 1)
39 #define MCA_PML_OB1_HDR_TYPE_RNDV (MCA_BTL_TAG_PML + 2)
40 #define MCA_PML_OB1_HDR_TYPE_RGET (MCA_BTL_TAG_PML + 3)
41 #define MCA_PML_OB1_HDR_TYPE_ACK (MCA_BTL_TAG_PML + 4)
42 #define MCA_PML_OB1_HDR_TYPE_NACK (MCA_BTL_TAG_PML + 5)
43 #define MCA_PML_OB1_HDR_TYPE_FRAG (MCA_BTL_TAG_PML + 6)
44 #define MCA_PML_OB1_HDR_TYPE_GET (MCA_BTL_TAG_PML + 7)
45 #define MCA_PML_OB1_HDR_TYPE_PUT (MCA_BTL_TAG_PML + 8)
46 #define MCA_PML_OB1_HDR_TYPE_FIN (MCA_BTL_TAG_PML + 9)
48 #define MCA_PML_OB1_HDR_FLAGS_ACK 1
49 #define MCA_PML_OB1_HDR_FLAGS_NBO 2
50 #define MCA_PML_OB1_HDR_FLAGS_PIN 4
51 #define MCA_PML_OB1_HDR_FLAGS_CONTIG 8
52 #define MCA_PML_OB1_HDR_FLAGS_NORDMA 16
63 #define MCA_PML_OB1_COMMON_HDR_NTOH(h)
64 #define MCA_PML_OB1_COMMON_HDR_HTON(h)
76 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
77 uint8_t hdr_padding[2];
80 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
81 #define OMPI_PML_OB1_MATCH_HDR_LEN 16
83 #define OMPI_PML_OB1_MATCH_HDR_LEN 14
88 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT && OPAL_ENABLE_DEBUG
89 #define MCA_PML_OB1_MATCH_HDR_FILL(h) \
91 (h).hdr_padding[0] = 0; \
92 (h).hdr_padding[1] = 0; \
95 #define MCA_PML_OB1_MATCH_HDR_FILL(h)
98 #define MCA_PML_OB1_MATCH_HDR_NTOH(h) \
100 MCA_PML_OB1_COMMON_HDR_NTOH((h).hdr_common); \
101 (h).hdr_ctx = ntohs((h).hdr_ctx); \
102 (h).hdr_src = ntohl((h).hdr_src); \
103 (h).hdr_tag = ntohl((h).hdr_tag); \
104 (h).hdr_seq = ntohs((h).hdr_seq); \
107 #define MCA_PML_OB1_MATCH_HDR_HTON(h) \
109 MCA_PML_OB1_COMMON_HDR_HTON((h).hdr_common); \
110 MCA_PML_OB1_MATCH_HDR_FILL(h); \
111 (h).hdr_ctx = htons((h).hdr_ctx); \
112 (h).hdr_src = htonl((h).hdr_src); \
113 (h).hdr_tag = htonl((h).hdr_tag); \
114 (h).hdr_seq = htons((h).hdr_seq); \
129 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT && OPAL_ENABLE_DEBUG
130 #define MCA_PML_OB1_RNDV_HDR_FILL(h) \
131 MCA_PML_OB1_MATCH_HDR_FILL((h).hdr_match)
133 #define MCA_PML_OB1_RNDV_HDR_FILL(h)
139 #define MCA_PML_OB1_RNDV_HDR_NTOH(h) \
141 MCA_PML_OB1_MATCH_HDR_NTOH((h).hdr_match); \
142 (h).hdr_msg_length = ntoh64((h).hdr_msg_length); \
145 #define MCA_PML_OB1_RNDV_HDR_HTON(h) \
147 MCA_PML_OB1_MATCH_HDR_HTON((h).hdr_match); \
148 MCA_PML_OB1_RNDV_HDR_FILL(h); \
149 (h).hdr_msg_length = hton64((h).hdr_msg_length); \
158 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
159 uint8_t hdr_padding[4];
166 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT && OPAL_ENABLE_DEBUG
167 #define MCA_PML_OB1_RGET_HDR_FILL(h) \
169 MCA_PML_OB1_RNDV_HDR_FILL((h).hdr_rndv); \
170 (h).hdr_padding[0] = 0; \
171 (h).hdr_padding[1] = 0; \
172 (h).hdr_padding[2] = 0; \
173 (h).hdr_padding[3] = 0; \
176 #define MCA_PML_OB1_RGET_HDR_FILL(h)
179 #define MCA_PML_OB1_RGET_HDR_NTOH(h) \
181 MCA_PML_OB1_RNDV_HDR_NTOH((h).hdr_rndv); \
182 (h).hdr_seg_cnt = ntohl((h).hdr_seg_cnt); \
185 #define MCA_PML_OB1_RGET_HDR_HTON(h) \
187 MCA_PML_OB1_RNDV_HDR_HTON((h).hdr_rndv); \
188 MCA_PML_OB1_RGET_HDR_FILL(h); \
189 (h).hdr_seg_cnt = htonl((h).hdr_seg_cnt); \
197 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
198 uint8_t hdr_padding[6];
206 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT && OPAL_ENABLE_DEBUG
207 #define MCA_PML_OB1_FRAG_HDR_FILL(h) \
209 (h).hdr_padding[0] = 0; \
210 (h).hdr_padding[1] = 0; \
211 (h).hdr_padding[2] = 0; \
212 (h).hdr_padding[3] = 0; \
213 (h).hdr_padding[4] = 0; \
214 (h).hdr_padding[5] = 0; \
217 #define MCA_PML_OB1_FRAG_HDR_FILL(h)
220 #define MCA_PML_OB1_FRAG_HDR_NTOH(h) \
222 MCA_PML_OB1_COMMON_HDR_NTOH((h).hdr_common); \
223 (h).hdr_frag_offset = ntoh64((h).hdr_frag_offset); \
226 #define MCA_PML_OB1_FRAG_HDR_HTON(h) \
228 MCA_PML_OB1_COMMON_HDR_HTON((h).hdr_common); \
229 MCA_PML_OB1_FRAG_HDR_FILL(h); \
230 (h).hdr_frag_offset = hton64((h).hdr_frag_offset); \
239 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
240 uint8_t hdr_padding[6];
248 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT && OPAL_ENABLE_DEBUG
249 #define MCA_PML_OB1_ACK_HDR_FILL(h) \
251 (h).hdr_padding[0] = 0; \
252 (h).hdr_padding[1] = 0; \
253 (h).hdr_padding[2] = 0; \
254 (h).hdr_padding[3] = 0; \
255 (h).hdr_padding[4] = 0; \
256 (h).hdr_padding[5] = 0; \
259 #define MCA_PML_OB1_ACK_HDR_FILL(h)
266 #define MCA_PML_OB1_ACK_HDR_NTOH(h) \
268 MCA_PML_OB1_COMMON_HDR_NTOH((h).hdr_common); \
269 (h).hdr_send_offset = ntoh64((h).hdr_send_offset); \
272 #define MCA_PML_OB1_ACK_HDR_HTON(h) \
274 MCA_PML_OB1_COMMON_HDR_HTON((h).hdr_common); \
275 MCA_PML_OB1_ACK_HDR_FILL(h); \
276 (h).hdr_send_offset = hton64((h).hdr_send_offset); \
285 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
286 uint8_t hdr_padding[2];
296 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT && OPAL_ENABLE_DEBUG
297 #define MCA_PML_OB1_RDMA_HDR_FILL(h) \
299 (h).hdr_padding[0] = 0; \
300 (h).hdr_padding[1] = 0; \
303 #define MCA_PML_OB1_RDMA_HDR_FILL(h)
306 #define MCA_PML_OB1_RDMA_HDR_NTOH(h) \
308 MCA_PML_OB1_COMMON_HDR_NTOH((h).hdr_common); \
309 (h).hdr_seg_cnt = ntohl((h).hdr_seg_cnt); \
310 (h).hdr_rdma_offset = ntoh64((h).hdr_rdma_offset); \
313 #define MCA_PML_OB1_RDMA_HDR_HTON(h) \
315 MCA_PML_OB1_COMMON_HDR_HTON((h).hdr_common); \
316 MCA_PML_OB1_RDMA_HDR_FILL(h); \
317 (h).hdr_seg_cnt = htonl((h).hdr_seg_cnt); \
318 (h).hdr_rdma_offset = hton64((h).hdr_rdma_offset); \
327 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
328 uint8_t hdr_padding[2];
335 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT && OPAL_ENABLE_DEBUG
336 #define MCA_PML_OB1_FIN_HDR_FILL(h) \
338 (h).hdr_padding[0] = 0; \
339 (h).hdr_padding[1] = 0; \
342 #define MCA_PML_OB1_FIN_HDR_FILL(h)
345 #define MCA_PML_OB1_FIN_HDR_NTOH(h) \
347 MCA_PML_OB1_COMMON_HDR_NTOH((h).hdr_common); \
350 #define MCA_PML_OB1_FIN_HDR_HTON(h) \
352 MCA_PML_OB1_COMMON_HDR_HTON((h).hdr_common); \
353 MCA_PML_OB1_FIN_HDR_FILL(h); \
371 #if !defined(WORDS_BIGENDIAN) && OPAL_ENABLE_HETEROGENEOUS_SUPPORT
372 static inline __opal_attribute_always_inline__
void
375 if(!(hdr->hdr_common.
hdr_flags & MCA_PML_OB1_HDR_FLAGS_NBO))
379 case MCA_PML_OB1_HDR_TYPE_MATCH:
380 MCA_PML_OB1_MATCH_HDR_NTOH(hdr->hdr_match);
382 case MCA_PML_OB1_HDR_TYPE_RNDV:
383 MCA_PML_OB1_RNDV_HDR_NTOH(hdr->hdr_rndv);
385 case MCA_PML_OB1_HDR_TYPE_RGET:
386 MCA_PML_OB1_RGET_HDR_NTOH(hdr->hdr_rget);
388 case MCA_PML_OB1_HDR_TYPE_ACK:
389 MCA_PML_OB1_ACK_HDR_NTOH(hdr->hdr_ack);
391 case MCA_PML_OB1_HDR_TYPE_FRAG:
392 MCA_PML_OB1_FRAG_HDR_NTOH(hdr->hdr_frag);
394 case MCA_PML_OB1_HDR_TYPE_PUT:
395 MCA_PML_OB1_RDMA_HDR_NTOH(hdr->hdr_rdma);
397 case MCA_PML_OB1_HDR_TYPE_FIN:
398 MCA_PML_OB1_FIN_HDR_NTOH(hdr->hdr_fin);
406 #define ob1_hdr_ntoh(h, t) do{}while(0)
409 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
410 #define ob1_hdr_hton(h, t, p) \
411 ob1_hdr_hton_intr((mca_pml_ob1_hdr_t*)h, t, p)
412 static inline __opal_attribute_always_inline__
void
416 #ifdef WORDS_BIGENDIAN
417 hdr->hdr_common.
hdr_flags |= MCA_PML_OB1_HDR_FLAGS_NBO;
420 if(!(proc->
proc_arch & OPAL_ARCH_ISBIGENDIAN))
423 hdr->hdr_common.
hdr_flags |= MCA_PML_OB1_HDR_FLAGS_NBO;
425 case MCA_PML_OB1_HDR_TYPE_MATCH:
426 MCA_PML_OB1_MATCH_HDR_HTON(hdr->hdr_match);
428 case MCA_PML_OB1_HDR_TYPE_RNDV:
429 MCA_PML_OB1_RNDV_HDR_HTON(hdr->hdr_rndv);
431 case MCA_PML_OB1_HDR_TYPE_RGET:
432 MCA_PML_OB1_RGET_HDR_HTON(hdr->hdr_rget);
434 case MCA_PML_OB1_HDR_TYPE_ACK:
435 MCA_PML_OB1_ACK_HDR_HTON(hdr->hdr_ack);
437 case MCA_PML_OB1_HDR_TYPE_FRAG:
438 MCA_PML_OB1_FRAG_HDR_HTON(hdr->hdr_frag);
440 case MCA_PML_OB1_HDR_TYPE_PUT:
441 MCA_PML_OB1_RDMA_HDR_HTON(hdr->hdr_rdma);
443 case MCA_PML_OB1_HDR_TYPE_FIN:
444 MCA_PML_OB1_FIN_HDR_HTON(hdr->hdr_fin);
453 #define ob1_hdr_hton(h, t, p) do{}while(0)
int32_t hdr_tag
user tag
Definition: pml_ob1_hdr.h:74
Header used to complete an RDMA operation.
Definition: pml_ob1_hdr.h:325
ompi_ptr_t hdr_dst_req
pointer to matched receive
Definition: pml_ob1_hdr.h:202
Header definition for a combined rdma rendezvous/get.
Definition: pml_ob1_hdr.h:155
Header used to initiate an RDMA operation.
Definition: pml_ob1_hdr.h:283
mca_pml_ob1_common_hdr_t hdr_common
common attributes
Definition: pml_ob1_hdr.h:284
mca_btl_base_segment_t hdr_segs[1]
list of segments for rdma
Definition: pml_ob1_hdr.h:292
Common hdr attributes - must be first element in each hdr type.
Definition: pml_ob1_hdr.h:57
uint64_t hdr_msg_length
message length
Definition: pml_ob1_hdr.h:124
ompi_ptr_t hdr_des
source descriptor
Definition: pml_ob1_hdr.h:161
ompi_ptr_t hdr_req
destination request
Definition: pml_ob1_hdr.h:289
uint32_t hdr_seg_cnt
number of segments for rdma
Definition: pml_ob1_hdr.h:288
Header definition for the first fragment, contains the attributes required to match the corresponding...
Definition: pml_ob1_hdr.h:70
ompi_ptr_t hdr_src_req
pointer to source request
Definition: pml_ob1_hdr.h:201
Process identification structure interface.
Remote Open MPI process structure.
Definition: proc.h:56
Header definition for the first fragment when an acknowledgment is required.
Definition: pml_ob1_hdr.h:122
uint16_t hdr_ctx
communicator index
Definition: pml_ob1_hdr.h:72
mca_btl_base_segment_t hdr_segs[1]
list of segments for rdma
Definition: pml_ob1_hdr.h:162
mca_pml_ob1_common_hdr_t hdr_common
common attributes
Definition: pml_ob1_hdr.h:238
ompi_ptr_t hdr_src_req
source request
Definition: pml_ob1_hdr.h:242
Union of defined hdr types.
Definition: pml_ob1_hdr.h:359
uint8_t hdr_type
type of envelope
Definition: pml_ob1_hdr.h:58
uint32_t hdr_seg_cnt
number of segments for rdma
Definition: pml_ob1_hdr.h:157
int32_t hdr_src
source rank
Definition: pml_ob1_hdr.h:73
ompi_ptr_t hdr_dst_req
matched receive request
Definition: pml_ob1_hdr.h:243
Byte Transfer Layer (BTL)
ompi_ptr_t hdr_src_req
pointer to source request - returned in ack
Definition: pml_ob1_hdr.h:125
mca_pml_ob1_common_hdr_t hdr_common
common attributes
Definition: pml_ob1_hdr.h:71
uint32_t hdr_fail
RDMA operation failed.
Definition: pml_ob1_hdr.h:330
ompi_ptr_t hdr_des
source descriptor
Definition: pml_ob1_hdr.h:290
mca_pml_ob1_common_hdr_t hdr_common
common attributes
Definition: pml_ob1_hdr.h:326
ompi_ptr_t hdr_des
completed descriptor
Definition: pml_ob1_hdr.h:331
uint64_t hdr_frag_offset
offset into message
Definition: pml_ob1_hdr.h:200
uint32_t proc_arch
architecture of this process
Definition: proc.h:66
uint64_t hdr_rdma_offset
current offset into user buffer
Definition: pml_ob1_hdr.h:291
mca_pml_ob1_common_hdr_t hdr_common
common attributes
Definition: pml_ob1_hdr.h:196
Header for subsequent fragments.
Definition: pml_ob1_hdr.h:195
Header used to acknowledgment outstanding fragment(s).
Definition: pml_ob1_hdr.h:237
uint16_t hdr_seq
message sequence number
Definition: pml_ob1_hdr.h:75
uint64_t hdr_send_offset
starting point of copy in/out
Definition: pml_ob1_hdr.h:244
Describes a region/segment of memory that is addressable by an BTL.
Definition: btl.h:236
uint8_t hdr_flags
flags indicating how fragment should be processed
Definition: pml_ob1_hdr.h:59