OpenMPI 0.1.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

btl_openib_eager_rdma.h
1 /*
2 * Copyright (c) 2006-2007 Voltaire All rights reserved.
3 * $COPYRIGHT$
4 *
5 * Additional copyrights may follow
6 *
7 * $HEADER$
8 */
9
10 #ifndef MCA_BTL_OPENIB_EAGER_RDMA_BUF_H
11 #define MCA_BTL_OPENIB_EAGER_RDMA_BUF_H
12
13 #include "ompi_config.h"
14 #include "btl_openib.h"
15
16 BEGIN_C_DECLS
17
18 struct mca_btl_openib_eager_rdma_local_t {
19 ompi_ptr_t base; /**< buffer for RDMAing eager messages */
20 mca_btl_openib_recv_frag_t *frags;
21 mca_btl_openib_reg_t *reg;
22 uint16_t head; /**< RDMA buffer to poll */
23 uint16_t tail; /**< Needed for credit managment */
24 int32_t credits; /**< number of RDMA credits */
25 int32_t rd_win;
26 #if OPAL_ENABLE_DEBUG
27 uint32_t seq;
28 #endif
29 opal_mutex_t lock; /**< guard access to RDMA buffer */
30 int32_t rd_low;
31 };
32 typedef struct mca_btl_openib_eager_rdma_local_t mca_btl_openib_eager_rdma_local_t;
33
34 struct mca_btl_openib_eager_rdma_remote_t {
35 ompi_ptr_t base; /**< address of remote buffer */
36 uint32_t rkey; /**< RKey for accessing remote buffer */
37 int32_t head; /**< RDMA buffer to post to */
38 int32_t tokens; /**< number of rdam tokens */
39 #if OPAL_ENABLE_DEBUG
40 uint32_t seq;
41 #endif
42 };
43 typedef struct mca_btl_openib_eager_rdma_remote_t mca_btl_openib_eager_rdma_remote_t;
44
45 #define MCA_BTL_OPENIB_RDMA_FRAG(F) \
46 (openib_frag_type(F) == MCA_BTL_OPENIB_FRAG_EAGER_RDMA)
47
48 #define EAGER_RDMA_BUFFER_REMOTE (0)
49 #define EAGER_RDMA_BUFFER_LOCAL (0xff)
50
51 #ifdef WORDS_BIGENDIAN
52 #define MCA_BTL_OPENIB_RDMA_FRAG_GET_SIZE(F) ((F)->u.size >> 8)
53 #define MCA_BTL_OPENIB_RDMA_FRAG_SET_SIZE(F, S) \
54 ((F)->u.size = (S) << 8)
55 #else
56 #define MCA_BTL_OPENIB_RDMA_FRAG_GET_SIZE(F) ((F)->u.size & 0x00ffffff)
57 #define MCA_BTL_OPENIB_RDMA_FRAG_SET_SIZE(F, S) \
58 ((F)->u.size = (S) & 0x00ffffff)
59 #endif
60
61 #define MCA_BTL_OPENIB_RDMA_FRAG_LOCAL(F) \
62 (((volatile uint8_t*)(F)->ftr->u.buf)[3] != EAGER_RDMA_BUFFER_REMOTE)
63
64 #define MCA_BTL_OPENIB_RDMA_FRAG_REMOTE(F) \
65 (!MCA_BTL_OPENIB_RDMA_FRAG_LOCAL(F))
66
67 #define MCA_BTL_OPENIB_RDMA_MAKE_REMOTE(F) do { \
68 ((volatile uint8_t*)(F)->u.buf)[3] = EAGER_RDMA_BUFFER_REMOTE; \
69 }while (0)
70
71 #define MCA_BTL_OPENIB_RDMA_MAKE_LOCAL(F) do { \
72 ((volatile uint8_t*)(F)->u.buf)[3] = EAGER_RDMA_BUFFER_LOCAL; \
73 }while (0)
74
75 #define MCA_BTL_OPENIB_GET_LOCAL_RDMA_FRAG(E, I) \
76 (&(E)->eager_rdma_local.frags[(I)])
77
78 #define MCA_BTL_OPENIB_RDMA_NEXT_INDEX(I) do { \
79 (I) = ((I) + 1); \
80 if((I) == \
81 mca_btl_openib_component.eager_rdma_num) \
82 (I) = 0; \
83 } while (0)
84 #define MCA_BTL_OPENIB_RDMA_MOVE_INDEX(HEAD, OLD_HEAD) \
85 do { \
86 int32_t new_head; \
87 do { \
88 OLD_HEAD = HEAD; \
89 new_head = OLD_HEAD + 1; \
90 if(new_head == mca_btl_openib_component.eager_rdma_num) \
91 new_head = 0; \
92 } while(!OPAL_ATOMIC_CMPSET_32(&HEAD, OLD_HEAD, new_head)); \
93 } while(0)
94
95
96 END_C_DECLS
97 #endif
98
mca_btl_openib_reg_t
Definition: btl_openib.h:470
mca_btl_openib_eager_rdma_remote_t::head
int32_t head
RDMA buffer to post to.
Definition: btl_openib_eager_rdma.h:37
mca_btl_openib_eager_rdma_local_t::base
ompi_ptr_t base
buffer for RDMAing eager messages
Definition: btl_openib_eager_rdma.h:19
mca_btl_openib_eager_rdma_local_t::credits
int32_t credits
number of RDMA credits
Definition: btl_openib_eager_rdma.h:24
mca_btl_openib_recv_frag_t
Definition: btl_openib_frag.h:334
ompi_ptr_t
Definition: types.h:52
opal_mutex_t
Definition: mutex_unix.h:53
mca_btl_openib_eager_rdma_remote_t::base
ompi_ptr_t base
address of remote buffer
Definition: btl_openib_eager_rdma.h:35
mca_btl_openib_eager_rdma_local_t::lock
opal_mutex_t lock
guard access to RDMA buffer
Definition: btl_openib_eager_rdma.h:29
mca_btl_openib_eager_rdma_remote_t
Definition: btl_openib_eager_rdma.h:34
mca_btl_openib_eager_rdma_remote_t::tokens
int32_t tokens
number of rdam tokens
Definition: btl_openib_eager_rdma.h:38
mca_btl_openib_eager_rdma_local_t::tail
uint16_t tail
Needed for credit managment.
Definition: btl_openib_eager_rdma.h:23
mca_btl_openib_eager_rdma_local_t
Definition: btl_openib_eager_rdma.h:18
mca_btl_openib_eager_rdma_local_t::head
uint16_t head
RDMA buffer to poll.
Definition: btl_openib_eager_rdma.h:22
mca_btl_openib_eager_rdma_remote_t::rkey
uint32_t rkey
RKey for accessing remote buffer.
Definition: btl_openib_eager_rdma.h:36