24 #ifndef MCA_PML_CSUM_HEADER_H
25 #define MCA_PML_CSUM_HEADER_H
27 #include "ompi_config.h"
28 #ifdef HAVE_SYS_TYPES_H
29 #include <sys/types.h>
31 #ifdef HAVE_NETINET_IN_H
32 #include <netinet/in.h>
35 #include "opal/types.h"
36 #include "opal/util/arch.h"
40 #define MCA_PML_CSUM_HDR_TYPE_MATCH (MCA_BTL_TAG_PML + 1)
41 #define MCA_PML_CSUM_HDR_TYPE_RNDV (MCA_BTL_TAG_PML + 2)
42 #define MCA_PML_CSUM_HDR_TYPE_RGET (MCA_BTL_TAG_PML + 3)
43 #define MCA_PML_CSUM_HDR_TYPE_ACK (MCA_BTL_TAG_PML + 4)
44 #define MCA_PML_CSUM_HDR_TYPE_NACK (MCA_BTL_TAG_PML + 5)
45 #define MCA_PML_CSUM_HDR_TYPE_FRAG (MCA_BTL_TAG_PML + 6)
46 #define MCA_PML_CSUM_HDR_TYPE_GET (MCA_BTL_TAG_PML + 7)
47 #define MCA_PML_CSUM_HDR_TYPE_PUT (MCA_BTL_TAG_PML + 8)
48 #define MCA_PML_CSUM_HDR_TYPE_FIN (MCA_BTL_TAG_PML + 9)
50 #define MCA_PML_CSUM_HDR_FLAGS_ACK 1
51 #define MCA_PML_CSUM_HDR_FLAGS_NBO 2
52 #define MCA_PML_CSUM_HDR_FLAGS_PIN 4
53 #define MCA_PML_CSUM_HDR_FLAGS_CONTIG 8
54 #define MCA_PML_CSUM_HDR_FLAGS_NORDMA 16
66 #define MCA_PML_CSUM_COMMON_HDR_NTOH(h) (h).hdr_csum = ntohs((h).hdr_csum);
67 #define MCA_PML_CSUM_COMMON_HDR_HTON(h) (h).hdr_csum = htons((h).hdr_csum);
81 #define OMPI_PML_CSUM_MATCH_HDR_LEN 20
85 #define MCA_PML_CSUM_MATCH_HDR_NTOH(h) \
87 MCA_PML_CSUM_COMMON_HDR_NTOH((h).hdr_common); \
88 (h).hdr_ctx = ntohs((h).hdr_ctx); \
89 (h).hdr_src = ntohl((h).hdr_src); \
90 (h).hdr_tag = ntohl((h).hdr_tag); \
91 (h).hdr_seq = ntohs((h).hdr_seq); \
92 (h).hdr_csum = ntohl((h).hdr_csum); \
95 #define MCA_PML_CSUM_MATCH_HDR_HTON(h) \
97 MCA_PML_CSUM_COMMON_HDR_HTON((h).hdr_common); \
98 (h).hdr_ctx = htons((h).hdr_ctx); \
99 (h).hdr_src = htonl((h).hdr_src); \
100 (h).hdr_tag = htonl((h).hdr_tag); \
101 (h).hdr_seq = htons((h).hdr_seq); \
102 (h).hdr_csum = htonl((h).hdr_csum); \
120 #define MCA_PML_CSUM_RNDV_HDR_NTOH(h) \
122 MCA_PML_CSUM_MATCH_HDR_NTOH((h).hdr_match); \
123 (h).hdr_msg_length = ntoh64((h).hdr_msg_length); \
126 #define MCA_PML_CSUM_RNDV_HDR_HTON(h) \
128 MCA_PML_CSUM_MATCH_HDR_HTON((h).hdr_match); \
129 (h).hdr_msg_length = hton64((h).hdr_msg_length); \
138 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
139 uint8_t hdr_padding[4];
146 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT && OPAL_ENABLE_DEBUG
147 #define MCA_PML_CSUM_RGET_HDR_FILL(h) \
149 (h).hdr_padding[0] = 0; \
150 (h).hdr_padding[1] = 0; \
151 (h).hdr_padding[2] = 0; \
152 (h).hdr_padding[3] = 0; \
155 #define MCA_PML_CSUM_RGET_HDR_FILL(h)
158 #define MCA_PML_CSUM_RGET_HDR_NTOH(h) \
160 MCA_PML_CSUM_RNDV_HDR_NTOH((h).hdr_rndv); \
161 (h).hdr_seg_cnt = ntohl((h).hdr_seg_cnt); \
164 #define MCA_PML_CSUM_RGET_HDR_HTON(h) \
166 MCA_PML_CSUM_RNDV_HDR_HTON((h).hdr_rndv); \
167 MCA_PML_CSUM_RGET_HDR_FILL(h); \
168 (h).hdr_seg_cnt = htonl((h).hdr_seg_cnt); \
183 #define MCA_PML_CSUM_FRAG_HDR_NTOH(h) \
185 MCA_PML_CSUM_COMMON_HDR_NTOH((h).hdr_common); \
186 (h).hdr_csum = ntohl((h).hdr_csum); \
187 (h).hdr_frag_offset = ntoh64((h).hdr_frag_offset); \
190 #define MCA_PML_CSUM_FRAG_HDR_HTON(h) \
192 MCA_PML_CSUM_COMMON_HDR_HTON((h).hdr_common); \
193 (h).hdr_csum = htonl((h).hdr_csum); \
194 (h).hdr_frag_offset = hton64((h).hdr_frag_offset); \
203 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
204 uint8_t hdr_padding[4];
212 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT && OPAL_ENABLE_DEBUG
213 #define MCA_PML_CSUM_ACK_HDR_FILL(h) \
215 (h).hdr_padding[0] = 0; \
216 (h).hdr_padding[1] = 0; \
217 (h).hdr_padding[2] = 0; \
218 (h).hdr_padding[3] = 0; \
221 #define MCA_PML_CSUM_ACK_HDR_FILL(h)
228 #define MCA_PML_CSUM_ACK_HDR_NTOH(h) \
230 MCA_PML_CSUM_COMMON_HDR_NTOH((h).hdr_common); \
231 (h).hdr_send_offset = ntoh64((h).hdr_send_offset); \
234 #define MCA_PML_CSUM_ACK_HDR_HTON(h) \
236 MCA_PML_CSUM_COMMON_HDR_HTON((h).hdr_common); \
237 MCA_PML_CSUM_ACK_HDR_FILL(h); \
238 (h).hdr_send_offset = hton64((h).hdr_send_offset); \
255 #define MCA_PML_CSUM_RDMA_HDR_NTOH(h) \
257 MCA_PML_CSUM_COMMON_HDR_NTOH((h).hdr_common); \
258 (h).hdr_seg_cnt = ntohl((h).hdr_seg_cnt); \
259 (h).hdr_rdma_offset = ntoh64((h).hdr_rdma_offset); \
262 #define MCA_PML_CSUM_RDMA_HDR_HTON(h) \
264 MCA_PML_CSUM_COMMON_HDR_HTON((h).hdr_common); \
265 (h).hdr_seg_cnt = htonl((h).hdr_seg_cnt); \
266 (h).hdr_rdma_offset = hton64((h).hdr_rdma_offset); \
281 #define MCA_PML_CSUM_FIN_HDR_NTOH(h) \
283 MCA_PML_CSUM_COMMON_HDR_NTOH((h).hdr_common); \
284 (h).hdr_csum = ntohl((h).hdr_csum); \
285 (h).hdr_fail = ntohl((h).hdr_fail); \
288 #define MCA_PML_CSUM_FIN_HDR_HTON(h) \
290 MCA_PML_CSUM_COMMON_HDR_HTON((h).hdr_common); \
291 (h).hdr_csum = htonl((h).hdr_csum); \
292 (h).hdr_fail = htonl((h).hdr_fail); \
310 #if !defined(WORDS_BIGENDIAN) && OPAL_ENABLE_HETEROGENEOUS_SUPPORT
311 static inline __opal_attribute_always_inline__
void
314 if(!(hdr->hdr_common.
hdr_flags & MCA_PML_CSUM_HDR_FLAGS_NBO))
318 case MCA_PML_CSUM_HDR_TYPE_MATCH:
319 MCA_PML_CSUM_MATCH_HDR_NTOH(hdr->hdr_match);
321 case MCA_PML_CSUM_HDR_TYPE_RNDV:
322 MCA_PML_CSUM_RNDV_HDR_NTOH(hdr->hdr_rndv);
324 case MCA_PML_CSUM_HDR_TYPE_RGET:
325 MCA_PML_CSUM_RGET_HDR_NTOH(hdr->hdr_rget);
327 case MCA_PML_CSUM_HDR_TYPE_ACK:
328 MCA_PML_CSUM_ACK_HDR_NTOH(hdr->hdr_ack);
330 case MCA_PML_CSUM_HDR_TYPE_FRAG:
331 MCA_PML_CSUM_FRAG_HDR_NTOH(hdr->hdr_frag);
333 case MCA_PML_CSUM_HDR_TYPE_PUT:
334 MCA_PML_CSUM_RDMA_HDR_NTOH(hdr->hdr_rdma);
336 case MCA_PML_CSUM_HDR_TYPE_FIN:
337 MCA_PML_CSUM_FIN_HDR_NTOH(hdr->hdr_fin);
345 #define csum_hdr_ntoh(h, t) do{}while(0)
348 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
349 #define csum_hdr_hton(h, t, p) \
350 csum_hdr_hton_intr((mca_pml_csum_hdr_t*)h, t, p)
351 static inline __opal_attribute_always_inline__
void
355 #ifdef WORDS_BIGENDIAN
356 hdr->hdr_common.
hdr_flags |= MCA_PML_CSUM_HDR_FLAGS_NBO;
359 if(!(proc->
proc_arch & OPAL_ARCH_ISBIGENDIAN))
362 hdr->hdr_common.
hdr_flags |= MCA_PML_CSUM_HDR_FLAGS_NBO;
364 case MCA_PML_CSUM_HDR_TYPE_MATCH:
365 MCA_PML_CSUM_MATCH_HDR_HTON(hdr->hdr_match);
367 case MCA_PML_CSUM_HDR_TYPE_RNDV:
368 MCA_PML_CSUM_RNDV_HDR_HTON(hdr->hdr_rndv);
370 case MCA_PML_CSUM_HDR_TYPE_RGET:
371 MCA_PML_CSUM_RGET_HDR_HTON(hdr->hdr_rget);
373 case MCA_PML_CSUM_HDR_TYPE_ACK:
374 MCA_PML_CSUM_ACK_HDR_HTON(hdr->hdr_ack);
376 case MCA_PML_CSUM_HDR_TYPE_FRAG:
377 MCA_PML_CSUM_FRAG_HDR_HTON(hdr->hdr_frag);
379 case MCA_PML_CSUM_HDR_TYPE_PUT:
380 MCA_PML_CSUM_RDMA_HDR_HTON(hdr->hdr_rdma);
382 case MCA_PML_CSUM_HDR_TYPE_FIN:
383 MCA_PML_CSUM_FIN_HDR_HTON(hdr->hdr_fin);
392 #define csum_hdr_hton(h, t, p) do{}while(0)
Header used to initiate an RDMA operation.
Definition: pml_csum_hdr.h:245
uint8_t hdr_flags
flags indicating how fragment should be processed
Definition: pml_csum_hdr.h:61
mca_pml_csum_common_hdr_t hdr_common
common attributes
Definition: pml_csum_hdr.h:175
int32_t hdr_tag
user tag
Definition: pml_csum_hdr.h:78
uint32_t hdr_seg_cnt
number of segments for rdma
Definition: pml_csum_hdr.h:247
uint64_t hdr_rdma_offset
current offset into user buffer
Definition: pml_csum_hdr.h:250
Header definition for a combined rdma rendezvous/get.
Definition: pml_csum_hdr.h:135
mca_btl_base_segment_t hdr_segs[1]
list of segments for rdma
Definition: pml_csum_hdr.h:251
ompi_ptr_t hdr_src_req
pointer to source request
Definition: pml_csum_hdr.h:178
uint64_t hdr_send_offset
starting point of copy in/out
Definition: pml_csum_hdr.h:208
Header definition for the first fragment, contains the attributes required to match the corresponding...
Definition: pml_csum_hdr.h:73
mca_pml_csum_common_hdr_t hdr_common
common attributes
Definition: pml_csum_hdr.h:274
Common hdr attributes - must be first element in each hdr type.
Definition: pml_csum_hdr.h:59
ompi_ptr_t hdr_des
completed descriptor
Definition: pml_csum_hdr.h:276
Union of defined hdr types.
Definition: pml_csum_hdr.h:298
mca_pml_csum_common_hdr_t hdr_common
common attributes
Definition: pml_csum_hdr.h:246
Header for subsequent fragments.
Definition: pml_csum_hdr.h:174
Process identification structure interface.
Remote Open MPI process structure.
Definition: proc.h:56
ompi_ptr_t hdr_des
source descriptor
Definition: pml_csum_hdr.h:249
Header used to acknowledgment outstanding fragment(s).
Definition: pml_csum_hdr.h:201
uint32_t hdr_seg_cnt
number of segments for rdma
Definition: pml_csum_hdr.h:137
Header definition for the first fragment when an acknowledgment is required.
Definition: pml_csum_hdr.h:110
ompi_ptr_t hdr_des
source descriptor
Definition: pml_csum_hdr.h:141
int32_t hdr_src
source rank
Definition: pml_csum_hdr.h:77
Byte Transfer Layer (BTL)
ompi_ptr_t hdr_src_req
source request
Definition: pml_csum_hdr.h:206
mca_pml_csum_common_hdr_t hdr_common
common attributes
Definition: pml_csum_hdr.h:74
uint64_t hdr_msg_length
message length
Definition: pml_csum_hdr.h:112
uint16_t hdr_csum
checksum over header
Definition: pml_csum_hdr.h:62
mca_btl_base_segment_t hdr_segs[1]
list of segments for rdma
Definition: pml_csum_hdr.h:142
ompi_ptr_t hdr_src_req
pointer to source request - returned in ack
Definition: pml_csum_hdr.h:113
uint32_t hdr_csum
checksum over data
Definition: pml_csum_hdr.h:79
uint8_t hdr_type
type of envelope
Definition: pml_csum_hdr.h:60
mca_pml_csum_common_hdr_t hdr_common
common attributes
Definition: pml_csum_hdr.h:202
uint32_t hdr_fail
RDMA operation failed.
Definition: pml_csum_hdr.h:277
ompi_ptr_t hdr_req
destination request
Definition: pml_csum_hdr.h:248
uint32_t proc_arch
architecture of this process
Definition: proc.h:66
ompi_ptr_t hdr_dst_req
pointer to matched receive
Definition: pml_csum_hdr.h:179
uint64_t hdr_frag_offset
offset into message
Definition: pml_csum_hdr.h:177
uint16_t hdr_seq
message sequence number
Definition: pml_csum_hdr.h:76
Header used to complete an RDMA operation.
Definition: pml_csum_hdr.h:273
uint16_t hdr_ctx
communicator index
Definition: pml_csum_hdr.h:75
Describes a region/segment of memory that is addressable by an BTL.
Definition: btl.h:236
ompi_ptr_t hdr_dst_req
matched receive request
Definition: pml_csum_hdr.h:207