OpenMPI  0.1.1
pml_bfo_hdr.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3  * University Research and Technology
4  * Corporation. All rights reserved.
5  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
6  * University of Stuttgart. All rights reserved.
7  * Copyright (c) 2004-2005 The Regents of the University of California.
8  * All rights reserved.
9  * Copyright (c) 2009 IBM Corporation. All rights reserved.
10  * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
11  * $COPYRIGHT$
12  *
13  * Additional copyrights may follow
14  *
15  * $HEADER$
16  */
17 /**
18  * @file
19  */
20 #ifndef MCA_PML_BFO_HEADER_H
21 #define MCA_PML_BFO_HEADER_H
22 
23 #include "ompi_config.h"
24 #ifdef HAVE_SYS_TYPES_H
25 #include <sys/types.h>
26 #endif
27 #ifdef HAVE_NETINET_IN_H
28 #include <netinet/in.h>
29 #endif
30 
31 #include "opal/types.h"
32 #include "opal/util/arch.h"
33 #include "ompi/mca/btl/btl.h"
34 #include "ompi/proc/proc.h"
35 
36 #define MCA_PML_BFO_HDR_TYPE_MATCH (MCA_BTL_TAG_PML + 1)
37 #define MCA_PML_BFO_HDR_TYPE_RNDV (MCA_BTL_TAG_PML + 2)
38 #define MCA_PML_BFO_HDR_TYPE_RGET (MCA_BTL_TAG_PML + 3)
39 #define MCA_PML_BFO_HDR_TYPE_ACK (MCA_BTL_TAG_PML + 4)
40 #define MCA_PML_BFO_HDR_TYPE_NACK (MCA_BTL_TAG_PML + 5)
41 #define MCA_PML_BFO_HDR_TYPE_FRAG (MCA_BTL_TAG_PML + 6)
42 #define MCA_PML_BFO_HDR_TYPE_GET (MCA_BTL_TAG_PML + 7)
43 #define MCA_PML_BFO_HDR_TYPE_PUT (MCA_BTL_TAG_PML + 8)
44 #define MCA_PML_BFO_HDR_TYPE_FIN (MCA_BTL_TAG_PML + 9)
45 #if PML_BFO
46 #define MCA_PML_BFO_HDR_TYPE_RNDVRESTARTNOTIFY (MCA_BTL_TAG_PML + 10)
47 #define MCA_PML_BFO_HDR_TYPE_RNDVRESTARTACK (MCA_BTL_TAG_PML + 11)
48 #define MCA_PML_BFO_HDR_TYPE_RNDVRESTARTNACK (MCA_BTL_TAG_PML + 12)
49 #define MCA_PML_BFO_HDR_TYPE_RECVERRNOTIFY (MCA_BTL_TAG_PML + 13)
50 #endif /* PML_BFO */
51 
52 #define MCA_PML_BFO_HDR_FLAGS_ACK 1 /* is an ack required */
53 #define MCA_PML_BFO_HDR_FLAGS_NBO 2 /* is the hdr in network byte order */
54 #define MCA_PML_BFO_HDR_FLAGS_PIN 4 /* is user buffer pinned */
55 #define MCA_PML_BFO_HDR_FLAGS_CONTIG 8 /* is user buffer contiguous */
56 #define MCA_PML_BFO_HDR_FLAGS_NORDMA 16 /* rest will be send by copy-in-out */
57 #if PML_BFO
58 #define MCA_PML_BFO_HDR_FLAGS_RESTART 32 /* restart RNDV because of error */
59 #endif /* PML_BFO */
60 
61 /**
62  * Common hdr attributes - must be first element in each hdr type
63  */
65  uint8_t hdr_type; /**< type of envelope */
66  uint8_t hdr_flags; /**< flags indicating how fragment should be processed */
67 };
69 
70 #define MCA_PML_BFO_COMMON_HDR_NTOH(h)
71 #define MCA_PML_BFO_COMMON_HDR_HTON(h)
72 
73 /**
74  * Header definition for the first fragment, contains the
75  * attributes required to match the corresponding posted receive.
76  */
78  mca_pml_bfo_common_hdr_t hdr_common; /**< common attributes */
79  uint16_t hdr_ctx; /**< communicator index */
80  int32_t hdr_src; /**< source rank */
81  int32_t hdr_tag; /**< user tag */
82  uint16_t hdr_seq; /**< message sequence number */
83 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
84  uint8_t hdr_padding[2]; /**< explicitly pad to 16 bytes. Compilers seem to already prefer to do this, but make it explicit just in case */
85 #endif
86 };
87 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
88 #define OMPI_PML_BFO_MATCH_HDR_LEN 16
89 #else
90 #define OMPI_PML_BFO_MATCH_HDR_LEN 14
91 #endif
92 
94 
95 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT && OPAL_ENABLE_DEBUG
96 #define MCA_PML_BFO_MATCH_HDR_FILL(h) \
97 do { \
98  (h).hdr_padding[0] = 0; \
99  (h).hdr_padding[1] = 0; \
100 } while(0)
101 #else
102 #define MCA_PML_BFO_MATCH_HDR_FILL(h)
103 #endif /* OPAL_ENABLE_HETEROGENEOUS_SUPPORT && OPAL_ENABLE_DEBUG */
104 
105 #define MCA_PML_BFO_MATCH_HDR_NTOH(h) \
106 do { \
107  MCA_PML_BFO_COMMON_HDR_NTOH((h).hdr_common); \
108  (h).hdr_ctx = ntohs((h).hdr_ctx); \
109  (h).hdr_src = ntohl((h).hdr_src); \
110  (h).hdr_tag = ntohl((h).hdr_tag); \
111  (h).hdr_seq = ntohs((h).hdr_seq); \
112 } while (0)
113 
114 #define MCA_PML_BFO_MATCH_HDR_HTON(h) \
115 do { \
116  MCA_PML_BFO_COMMON_HDR_HTON((h).hdr_common); \
117  MCA_PML_BFO_MATCH_HDR_FILL(h); \
118  (h).hdr_ctx = htons((h).hdr_ctx); \
119  (h).hdr_src = htonl((h).hdr_src); \
120  (h).hdr_tag = htonl((h).hdr_tag); \
121  (h).hdr_seq = htons((h).hdr_seq); \
122 } while (0)
123 
124 /**
125  * Header definition for the first fragment when an acknowledgment
126  * is required. This could be the first fragment of a large message
127  * or a short message that requires an ack (synchronous).
128  */
130  mca_pml_bfo_match_hdr_t hdr_match;
131  uint64_t hdr_msg_length; /**< message length */
132  ompi_ptr_t hdr_src_req; /**< pointer to source request - returned in ack */
133 #if PML_BFO
134  ompi_ptr_t hdr_dst_req; /**< pointer to dst req */
135  uint8_t hdr_restartseq; /**< restart sequence */
136 #endif /* PML_BFO */
137 };
139 
140 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT && OPAL_ENABLE_DEBUG
141 #define MCA_PML_BFO_RNDV_HDR_FILL(h) \
142  MCA_PML_BFO_MATCH_HDR_FILL((h).hdr_match)
143 #else
144 #define MCA_PML_BFO_RNDV_HDR_FILL(h)
145 #endif /* OPAL_ENABLE_HETEROGENEOUS_SUPPORT && OPAL_ENABLE_DEBUG */
146 
147 /* Note that hdr_src_req is not put in network byte order because it
148  is never processed by the receiver, other than being copied into
149  the ack header */
150 #define MCA_PML_BFO_RNDV_HDR_NTOH(h) \
151  do { \
152  MCA_PML_BFO_MATCH_HDR_NTOH((h).hdr_match); \
153  (h).hdr_msg_length = ntoh64((h).hdr_msg_length); \
154  } while (0)
155 
156 #define MCA_PML_BFO_RNDV_HDR_HTON(h) \
157  do { \
158  MCA_PML_BFO_MATCH_HDR_HTON((h).hdr_match); \
159  MCA_PML_BFO_RNDV_HDR_FILL(h); \
160  (h).hdr_msg_length = hton64((h).hdr_msg_length); \
161  } while (0)
162 
163 /**
164  * Header definition for a combined rdma rendezvous/get
165  */
168  uint32_t hdr_seg_cnt; /**< number of segments for rdma */
169 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
170  uint8_t hdr_padding[4];
171 #endif
172  ompi_ptr_t hdr_des; /**< source descriptor */
173  mca_btl_base_segment_t hdr_segs[1]; /**< list of segments for rdma */
174 };
176 
177 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT && OPAL_ENABLE_DEBUG
178 #define MCA_PML_BFO_RGET_HDR_FILL(h) \
179 do { \
180  MCA_PML_BFO_RNDV_HDR_FILL((h).hdr_rndv); \
181  (h).hdr_padding[0] = 0; \
182  (h).hdr_padding[1] = 0; \
183  (h).hdr_padding[2] = 0; \
184  (h).hdr_padding[3] = 0; \
185 } while(0)
186 #else
187 #define MCA_PML_BFO_RGET_HDR_FILL(h)
188 #endif /* OPAL_ENABLE_HETEROGENEOUS_SUPPORT && OPAL_ENABLE_DEBUG */
189 
190 #define MCA_PML_BFO_RGET_HDR_NTOH(h) \
191  do { \
192  MCA_PML_BFO_RNDV_HDR_NTOH((h).hdr_rndv); \
193  (h).hdr_seg_cnt = ntohl((h).hdr_seg_cnt); \
194  } while (0)
195 
196 #define MCA_PML_BFO_RGET_HDR_HTON(h) \
197  do { \
198  MCA_PML_BFO_RNDV_HDR_HTON((h).hdr_rndv); \
199  MCA_PML_BFO_RGET_HDR_FILL(h); \
200  (h).hdr_seg_cnt = htonl((h).hdr_seg_cnt); \
201  } while (0)
202 
203 /**
204  * Header for subsequent fragments.
205  */
207  mca_pml_bfo_common_hdr_t hdr_common; /**< common attributes */
208 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
209  uint8_t hdr_padding[6];
210 #endif
211  uint64_t hdr_frag_offset; /**< offset into message */
212  ompi_ptr_t hdr_src_req; /**< pointer to source request */
213  ompi_ptr_t hdr_dst_req; /**< pointer to matched receive */
214 };
216 
217 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT && OPAL_ENABLE_DEBUG
218 #define MCA_PML_BFO_FRAG_HDR_FILL(h) \
219 do { \
220  (h).hdr_padding[0] = 0; \
221  (h).hdr_padding[1] = 0; \
222  (h).hdr_padding[2] = 0; \
223  (h).hdr_padding[3] = 0; \
224  (h).hdr_padding[4] = 0; \
225  (h).hdr_padding[5] = 0; \
226 } while(0)
227 #else
228 #define MCA_PML_BFO_FRAG_HDR_FILL(h)
229 #endif /* OPAL_ENABLE_HETEROGENEOUS_SUPPORT && OPAL_ENABLE_DEBUG */
230 
231 #define MCA_PML_BFO_FRAG_HDR_NTOH(h) \
232  do { \
233  MCA_PML_BFO_COMMON_HDR_NTOH((h).hdr_common); \
234  (h).hdr_frag_offset = ntoh64((h).hdr_frag_offset); \
235  } while (0)
236 
237 #define MCA_PML_BFO_FRAG_HDR_HTON(h) \
238  do { \
239  MCA_PML_BFO_COMMON_HDR_HTON((h).hdr_common); \
240  MCA_PML_BFO_FRAG_HDR_FILL(h); \
241  (h).hdr_frag_offset = hton64((h).hdr_frag_offset); \
242  } while (0)
243 
244 /**
245  * Header used to acknowledgment outstanding fragment(s).
246  */
247 
249  mca_pml_bfo_common_hdr_t hdr_common; /**< common attributes */
250 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
251  uint8_t hdr_padding[6];
252 #endif
253  ompi_ptr_t hdr_src_req; /**< source request */
254  ompi_ptr_t hdr_dst_req; /**< matched receive request */
255  uint64_t hdr_send_offset; /**< starting point of copy in/out */
256 };
258 
259 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT && OPAL_ENABLE_DEBUG
260 #define MCA_PML_BFO_ACK_HDR_FILL(h) \
261 do { \
262  (h).hdr_padding[0] = 0; \
263  (h).hdr_padding[1] = 0; \
264  (h).hdr_padding[2] = 0; \
265  (h).hdr_padding[3] = 0; \
266  (h).hdr_padding[4] = 0; \
267  (h).hdr_padding[5] = 0; \
268 } while (0)
269 #else
270 #define MCA_PML_BFO_ACK_HDR_FILL(h)
271 #endif /* OPAL_ENABLE_HETEROGENEOUS_SUPPORT && OPAL_ENABLE_DEBUG */
272 
273 /* Note that the request headers are not put in NBO because the
274  src_req is already in receiver's byte order and the dst_req is not
275  used by the receiver for anything other than backpointers in return
276  headers */
277 #define MCA_PML_BFO_ACK_HDR_NTOH(h) \
278  do { \
279  MCA_PML_BFO_COMMON_HDR_NTOH((h).hdr_common); \
280  (h).hdr_send_offset = ntoh64((h).hdr_send_offset); \
281  } while (0)
282 
283 #define MCA_PML_BFO_ACK_HDR_HTON(h) \
284  do { \
285  MCA_PML_BFO_COMMON_HDR_HTON((h).hdr_common); \
286  MCA_PML_BFO_ACK_HDR_FILL(h); \
287  (h).hdr_send_offset = hton64((h).hdr_send_offset); \
288  } while (0)
289 
290 /**
291  * Header used to initiate an RDMA operation.
292  */
293 
295  mca_pml_bfo_common_hdr_t hdr_common; /**< common attributes */
296 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
297  uint8_t hdr_padding[2]; /** two to pad out the hdr to a 4 byte alignment. hdr_req will then be 8 byte aligned after 4 for hdr_seg_cnt */
298 #endif
299  uint32_t hdr_seg_cnt; /**< number of segments for rdma */
300  ompi_ptr_t hdr_req; /**< destination request */
301 #if PML_BFO
302  ompi_ptr_t hdr_dst_req; /**< pointer to destination request */
303 #endif /* PML_BFO */
304  ompi_ptr_t hdr_des; /**< source descriptor */
305  uint64_t hdr_rdma_offset; /**< current offset into user buffer */
306  mca_btl_base_segment_t hdr_segs[1]; /**< list of segments for rdma */
307 };
309 
310 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT && OPAL_ENABLE_DEBUG
311 #define MCA_PML_BFO_RDMA_HDR_FILL(h) \
312 do { \
313  (h).hdr_padding[0] = 0; \
314  (h).hdr_padding[1] = 0; \
315 } while(0)
316 #else
317 #define MCA_PML_BFO_RDMA_HDR_FILL(h)
318 #endif /* OPAL_ENABLE_HETEROGENEOUS_SUPPORT && OPAL_ENABLE_DEBUG */
319 
320 #define MCA_PML_BFO_RDMA_HDR_NTOH(h) \
321  do { \
322  MCA_PML_BFO_COMMON_HDR_NTOH((h).hdr_common); \
323  (h).hdr_seg_cnt = ntohl((h).hdr_seg_cnt); \
324  (h).hdr_rdma_offset = ntoh64((h).hdr_rdma_offset); \
325  } while (0)
326 
327 #define MCA_PML_BFO_RDMA_HDR_HTON(h) \
328  do { \
329  MCA_PML_BFO_COMMON_HDR_HTON((h).hdr_common); \
330  MCA_PML_BFO_RDMA_HDR_FILL(h); \
331  (h).hdr_seg_cnt = htonl((h).hdr_seg_cnt); \
332  (h).hdr_rdma_offset = hton64((h).hdr_rdma_offset); \
333  } while (0)
334 
335 /**
336  * Header used to complete an RDMA operation.
337  */
338 
340  mca_pml_bfo_common_hdr_t hdr_common; /**< common attributes */
341 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
342  uint8_t hdr_padding[2];
343 #endif
344 #if PML_BFO
345  /* Match info is needed to check for duplicate FIN messages. */
346  mca_pml_bfo_match_hdr_t hdr_match;
347 #endif /* PML_BFO */
348  uint32_t hdr_fail; /**< RDMA operation failed */
349  ompi_ptr_t hdr_des; /**< completed descriptor */
350 };
352 
353 #if PML_BFO
354 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT && OPAL_ENABLE_DEBUG
355 #define MCA_PML_BFO_FIN_HDR_FILL(h) \
356 do { \
357  (h).hdr_padding[0] = 0; \
358  (h).hdr_padding[1] = 0; \
359  MCA_PML_BFO_MATCH_HDR_FILL((h).hdr_match); \
360 } while (0)
361 #else
362 #define MCA_PML_BFO_FIN_HDR_FILL(h)
363 #endif /* OPAL_ENABLE_HETEROGENEOUS_SUPPORT && OPAL_ENABLE_DEBUG */
364 
365 #define MCA_PML_BFO_FIN_HDR_NTOH(h) \
366  do { \
367  MCA_PML_BFO_COMMON_HDR_NTOH((h).hdr_common); \
368  MCA_PML_BFO_MATCH_HDR_NTOH((h).hdr_match); \
369  } while (0)
370 
371 #define MCA_PML_BFO_FIN_HDR_HTON(h) \
372  do { \
373  MCA_PML_BFO_COMMON_HDR_HTON((h).hdr_common); \
374  MCA_PML_BFO_MATCH_HDR_HTON((h).hdr_match); \
375  MCA_PML_BFO_FIN_HDR_FILL(h); \
376  } while (0)
377 #else /* PML_BFO */
378 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT && OPAL_ENABLE_DEBUG
379 #define MCA_PML_BFO_FIN_HDR_FILL(h) \
380 do { \
381  (h).hdr_padding[0] = 0; \
382  (h).hdr_padding[1] = 0; \
383 } while (0)
384 #else
385 #define MCA_PML_BFO_FIN_HDR_FILL(h)
386 #endif /* OPAL_ENABLE_HETEROGENEOUS_SUPPORT && OPAL_ENABLE_DEBUG */
387 
388 #define MCA_PML_BFO_FIN_HDR_NTOH(h) \
389  do { \
390  MCA_PML_BFO_COMMON_HDR_NTOH((h).hdr_common); \
391  } while (0)
392 
393 #define MCA_PML_BFO_FIN_HDR_HTON(h) \
394  do { \
395  MCA_PML_BFO_COMMON_HDR_HTON((h).hdr_common); \
396  MCA_PML_BFO_FIN_HDR_FILL(h); \
397  } while (0)
398 #endif /* PML_BFO */
399 
400 #if PML_BFO
401 /**
402  * Header used to restart a rendezvous request.
403  */
404 struct mca_pml_bfo_restart_hdr_t {
405  mca_pml_bfo_match_hdr_t hdr_match; /**< needed to avoid duplicate messages */
406  uint8_t hdr_restartseq; /**< restart sequence */
407 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
408  uint8_t hdr_padding[3];
409 #endif
410  ompi_ptr_t hdr_src_req; /**< source request */
411  ompi_ptr_t hdr_dst_req; /**< matched receive request */
412  int32_t hdr_dst_rank; /**< needed to send NACK */
413  uint32_t hdr_jobid; /**< needed to send NACK */
414  uint32_t hdr_vpid; /**< needed to send NACK */
415 };
416 typedef struct mca_pml_bfo_restart_hdr_t mca_pml_bfo_restart_hdr_t;
417 
418 /* Only need to put parts of the restart header in NBO. No need
419  to do hdr_src_req and hdr_dst_req as they are only used on the
420  by the process that originated them. */
421 #define MCA_PML_BFO_RESTART_HDR_NTOH(h) \
422  do { \
423  MCA_PML_BFO_MATCH_HDR_NTOH((h).hdr_match); \
424  (h).hdr_dst_rank = ntohl((h).hdr_dst_rank); \
425  (h).hdr_jobid = ntohl((h).hdr_jobid); \
426  (h).hdr_vpid = ntohl((h).hdr_vpid); \
427  } while (0)
428 
429 #define MCA_PML_BFO_RESTART_HDR_HTON(h) \
430  do { \
431  MCA_PML_BFO_MATCH_HDR_HTON((h).hdr_match); \
432  (h).hdr_dst_rank = htonl((h).hdr_dst_rank); \
433  (h).hdr_jobid = htonl((h).hdr_jobid); \
434  (h).hdr_vpid = htonl((h).hdr_vpid); \
435  } while (0)
436 
437 #endif /* PML_BFO */
438 /**
439  * Union of defined hdr types.
440  */
442  mca_pml_bfo_common_hdr_t hdr_common;
443  mca_pml_bfo_match_hdr_t hdr_match;
445  mca_pml_bfo_rget_hdr_t hdr_rget;
446  mca_pml_bfo_frag_hdr_t hdr_frag;
447  mca_pml_bfo_ack_hdr_t hdr_ack;
448  mca_pml_bfo_rdma_hdr_t hdr_rdma;
449  mca_pml_bfo_fin_hdr_t hdr_fin;
450 #if PML_BFO
451  mca_pml_bfo_restart_hdr_t hdr_restart;
452 #endif /* PML_BFO */
453 };
455 
456 #if !defined(WORDS_BIGENDIAN) && OPAL_ENABLE_HETEROGENEOUS_SUPPORT
457 static inline __opal_attribute_always_inline__ void
458 bfo_hdr_ntoh(mca_pml_bfo_hdr_t *hdr, const uint8_t hdr_type)
459 {
460  if(!(hdr->hdr_common.hdr_flags & MCA_PML_BFO_HDR_FLAGS_NBO))
461  return;
462 
463  switch(hdr_type) {
464  case MCA_PML_BFO_HDR_TYPE_MATCH:
465  MCA_PML_BFO_MATCH_HDR_NTOH(hdr->hdr_match);
466  break;
467  case MCA_PML_BFO_HDR_TYPE_RNDV:
468  MCA_PML_BFO_RNDV_HDR_NTOH(hdr->hdr_rndv);
469  break;
470  case MCA_PML_BFO_HDR_TYPE_RGET:
471  MCA_PML_BFO_RGET_HDR_NTOH(hdr->hdr_rget);
472  break;
473  case MCA_PML_BFO_HDR_TYPE_ACK:
474  MCA_PML_BFO_ACK_HDR_NTOH(hdr->hdr_ack);
475  break;
476  case MCA_PML_BFO_HDR_TYPE_FRAG:
477  MCA_PML_BFO_FRAG_HDR_NTOH(hdr->hdr_frag);
478  break;
479  case MCA_PML_BFO_HDR_TYPE_PUT:
480  MCA_PML_BFO_RDMA_HDR_NTOH(hdr->hdr_rdma);
481  break;
482  case MCA_PML_BFO_HDR_TYPE_FIN:
483  MCA_PML_BFO_FIN_HDR_NTOH(hdr->hdr_fin);
484  break;
485  default:
486  assert(0);
487  break;
488  }
489 }
490 #else
491 #define bfo_hdr_ntoh(h, t) do{}while(0)
492 #endif
493 
494 #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
495 #define bfo_hdr_hton(h, t, p) \
496  bfo_hdr_hton_intr((mca_pml_bfo_hdr_t*)h, t, p)
497 static inline __opal_attribute_always_inline__ void
498 bfo_hdr_hton_intr(mca_pml_bfo_hdr_t *hdr, const uint8_t hdr_type,
499  const ompi_proc_t *proc)
500 {
501 #ifdef WORDS_BIGENDIAN
502  hdr->hdr_common.hdr_flags |= MCA_PML_BFO_HDR_FLAGS_NBO;
503 #else
504 
505  if(!(proc->proc_arch & OPAL_ARCH_ISBIGENDIAN))
506  return;
507 
508  hdr->hdr_common.hdr_flags |= MCA_PML_BFO_HDR_FLAGS_NBO;
509  switch(hdr_type) {
510  case MCA_PML_BFO_HDR_TYPE_MATCH:
511  MCA_PML_BFO_MATCH_HDR_HTON(hdr->hdr_match);
512  break;
513  case MCA_PML_BFO_HDR_TYPE_RNDV:
514  MCA_PML_BFO_RNDV_HDR_HTON(hdr->hdr_rndv);
515  break;
516  case MCA_PML_BFO_HDR_TYPE_RGET:
517  MCA_PML_BFO_RGET_HDR_HTON(hdr->hdr_rget);
518  break;
519  case MCA_PML_BFO_HDR_TYPE_ACK:
520  MCA_PML_BFO_ACK_HDR_HTON(hdr->hdr_ack);
521  break;
522  case MCA_PML_BFO_HDR_TYPE_FRAG:
523  MCA_PML_BFO_FRAG_HDR_HTON(hdr->hdr_frag);
524  break;
525  case MCA_PML_BFO_HDR_TYPE_PUT:
526  MCA_PML_BFO_RDMA_HDR_HTON(hdr->hdr_rdma);
527  break;
528  case MCA_PML_BFO_HDR_TYPE_FIN:
529  MCA_PML_BFO_FIN_HDR_HTON(hdr->hdr_fin);
530  break;
531  default:
532  assert(0);
533  break;
534  }
535 #endif
536 }
537 #else
538 #define bfo_hdr_hton(h, t, p) do{}while(0)
539 #endif
540 #endif
Common hdr attributes - must be first element in each hdr type.
Definition: pml_bfo_hdr.h:64
Header definition for a combined rdma rendezvous/get.
Definition: pml_bfo_hdr.h:166
ompi_ptr_t hdr_src_req
source request
Definition: pml_bfo_hdr.h:253
ompi_ptr_t hdr_src_req
pointer to source request
Definition: pml_bfo_hdr.h:212
Header definition for the first fragment, contains the attributes required to match the corresponding...
Definition: pml_bfo_hdr.h:77
int32_t hdr_tag
user tag
Definition: pml_bfo_hdr.h:81
Definition: types.h:52
Union of defined hdr types.
Definition: pml_bfo_hdr.h:441
ompi_ptr_t hdr_dst_req
matched receive request
Definition: pml_bfo_hdr.h:254
Process identification structure interface.
Remote Open MPI process structure.
Definition: proc.h:56
ompi_ptr_t hdr_req
destination request
Definition: pml_bfo_hdr.h:300
ompi_ptr_t hdr_src_req
pointer to source request - returned in ack
Definition: pml_bfo_hdr.h:132
Header used to initiate an RDMA operation.
Definition: pml_bfo_hdr.h:294
mca_btl_base_segment_t hdr_segs[1]
list of segments for rdma
Definition: pml_bfo_hdr.h:173
Header used to complete an RDMA operation.
Definition: pml_bfo_hdr.h:339
Header used to acknowledgment outstanding fragment(s).
Definition: pml_bfo_hdr.h:248
mca_pml_bfo_common_hdr_t hdr_common
common attributes
Definition: pml_bfo_hdr.h:78
Header definition for the first fragment when an acknowledgment is required.
Definition: pml_bfo_hdr.h:129
ompi_ptr_t hdr_des
source descriptor
Definition: pml_bfo_hdr.h:172
Byte Transfer Layer (BTL)
mca_pml_bfo_common_hdr_t hdr_common
common attributes
Definition: pml_bfo_hdr.h:207
int32_t hdr_src
source rank
Definition: pml_bfo_hdr.h:80
uint8_t hdr_type
type of envelope
Definition: pml_bfo_hdr.h:65
Header for subsequent fragments.
Definition: pml_bfo_hdr.h:206
uint64_t hdr_frag_offset
offset into message
Definition: pml_bfo_hdr.h:211
mca_btl_base_segment_t hdr_segs[1]
list of segments for rdma
Definition: pml_bfo_hdr.h:306
mca_pml_bfo_common_hdr_t hdr_common
common attributes
Definition: pml_bfo_hdr.h:340
uint64_t hdr_rdma_offset
current offset into user buffer
Definition: pml_bfo_hdr.h:305
uint32_t hdr_seg_cnt
number of segments for rdma
Definition: pml_bfo_hdr.h:299
ompi_ptr_t hdr_des
completed descriptor
Definition: pml_bfo_hdr.h:349
mca_pml_bfo_common_hdr_t hdr_common
common attributes
Definition: pml_bfo_hdr.h:295
uint16_t hdr_ctx
communicator index
Definition: pml_bfo_hdr.h:79
uint32_t proc_arch
architecture of this process
Definition: proc.h:66
ompi_ptr_t hdr_des
source descriptor
Definition: pml_bfo_hdr.h:304
uint16_t hdr_seq
message sequence number
Definition: pml_bfo_hdr.h:82
ompi_ptr_t hdr_dst_req
pointer to matched receive
Definition: pml_bfo_hdr.h:213
uint64_t hdr_send_offset
starting point of copy in/out
Definition: pml_bfo_hdr.h:255
uint32_t hdr_seg_cnt
number of segments for rdma
Definition: pml_bfo_hdr.h:168
uint64_t hdr_msg_length
message length
Definition: pml_bfo_hdr.h:131
mca_pml_bfo_common_hdr_t hdr_common
common attributes
Definition: pml_bfo_hdr.h:249
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_bfo_hdr.h:66
uint32_t hdr_fail
RDMA operation failed.
Definition: pml_bfo_hdr.h:348