OpenMPI 0.1.1

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

- File List
- Globals

btl_udapl_eager_rdma.h
1 /*
2 * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved.
3 *
4 * $COPYRIGHT$
5 *
6 * Additional copyrights may follow
7 *
8 * $HEADER$
9 */
10
11 #ifndef MCA_BTL_UDAPL_EAGER_RDMA_H
12 #define MCA_BTL_UDAPL_EAGER_RDMA_H
13
14 /* Open MPI includes */
15 #include "ompi/mca/btl/udapl/btl_udapl_endpoint.h"
16
17
18 BEGIN_C_DECLS
19
20 /*
21 * Describe endpoint local memory region.
22 */
23 struct mca_btl_udapl_eager_rdma_local_t {
24 ompi_ptr_t base; /**< points to fragment structures */
25 struct mca_btl_udapl_reg_t* reg;
26 uint8_t head; /**< RDMA buffer to poll */
27 int32_t credits; /**< number of local rdma buffers ready to be reclaimed,
28 reused. Initially equal to 0. */
29 opal_mutex_t lock; /**< protect access to RDMA buffer */
30 };
31 typedef struct mca_btl_udapl_eager_rdma_local_t mca_btl_udapl_eager_rdma_local_t;
32
33 /*
34 * Describe endpoint remote memory region.
35 */
36 struct mca_btl_udapl_eager_rdma_remote_t {
37 ompi_ptr_t base; /**< points to start of data region, not
38 fragment structures */
39 DAT_RMR_CONTEXT rkey; /**< key required to access remote memory */
40 uint8_t head; /**< RDMA buffer to use */
41 int32_t tokens; /**< number of available rdma buffers, initially equal
42 to mca parameter eager_rdma_num */
43 opal_mutex_t lock; /**< protect access to RDMA buffer */
44 };
45 typedef struct mca_btl_udapl_eager_rdma_remote_t mca_btl_udapl_eager_rdma_remote_t;
46
47 /*
48 * Encapsulate data that describes a remote memory region.
49 */
50 struct mca_btl_udapl_eager_rdma_connect_t {
51 mca_btl_udapl_control_header_t control;
52 uint32_t rkey;
53 ompi_ptr_t rdma_start;
54 };
55 typedef struct mca_btl_udapl_eager_rdma_connect_t mca_btl_udapl_eager_rdma_connect_t;
56
57 /*
58 * Encapsulate data that describes rdma credit information.
59 */
60 struct mca_btl_udapl_eager_rdma_credit_t {
61 mca_btl_udapl_control_header_t control;
62 uint32_t credits;
63 };
64 typedef struct mca_btl_udapl_eager_rdma_credit_t mca_btl_udapl_eager_rdma_credit_t;
65
66 #define EAGER_RDMA_BUFFER_AVAILABLE (0)
67 #define EAGER_RDMA_BUFFER_IN_USE (0xff)
68
69 #define MCA_BTL_UDAPL_RDMA_FRAG_IN_USE(F) do { \
70 *(volatile uint8_t*) ((char*)(F) + \
71 (mca_btl_udapl_component.udapl_eager_rdma_frag_size - \
72 (sizeof(mca_btl_udapl_footer_t)))); \
73 } while (0)
74
75 #define MCA_BTL_UDAPL_RDMA_FRAG_ASSIGN_IN_USE(F) do { \
76 *(volatile uint8_t*) ((char*)(F) + \
77 (mca_btl_udapl_component.udapl_eager_rdma_frag_size- \
78 (sizeof(mca_btl_udapl_footer_t)))) = EAGER_RDMA_BUFFER_IN_USE; \
79 } while (0)
80
81 #define MCA_BTL_UDAPL_RDMA_FRAG_ASSIGN_AVAILABLE(F) do { \
82 *(volatile uint8_t*) ((char*)(F) + \
83 (mca_btl_udapl_component.udapl_eager_rdma_frag_size - \
84 (sizeof(mca_btl_udapl_footer_t)))) = EAGER_RDMA_BUFFER_AVAILABLE; \
85 } while (0)
86
87 /* Retrieve the rdma fragment at location I */
88 #define MCA_BTL_UDAPL_GET_LOCAL_RDMA_FRAG(E, I) \
89 (mca_btl_udapl_frag_t*) \
90 ((char*)(E)->endpoint_eager_rdma_local.base.pval + \
91 (I) * sizeof(mca_btl_udapl_frag_eager_rdma_t))
92
93 /*
94 * Increment the index I by one while not exceeding the total number of
95 * available eager rdma fragments
96 */
97 #define MCA_BTL_UDAPL_RDMA_NEXT_INDEX(I) do { \
98 (I) = ((I) + 1); \
99 if((I) == \
100 mca_btl_udapl_component.udapl_eager_rdma_num) \
101 (I) = 0; \
102 } while (0)
103
104 END_C_DECLS
105 #endif
mca_btl_udapl_eager_rdma_remote_t
Definition: btl_udapl_eager_rdma.h:36
mca_btl_udapl_eager_rdma_remote_t::tokens
int32_t tokens
number of available rdma buffers, initially equal to mca parameter eager_rdma_num ...
Definition: btl_udapl_eager_rdma.h:41
ompi_ptr_t
Definition: types.h:52
mca_btl_udapl_eager_rdma_local_t::credits
int32_t credits
number of local rdma buffers ready to be reclaimed, reused.
Definition: btl_udapl_eager_rdma.h:27
opal_mutex_t
Definition: mutex_unix.h:53
mca_btl_udapl_eager_rdma_remote_t::base
ompi_ptr_t base
points to start of data region, not fragment structures
Definition: btl_udapl_eager_rdma.h:37
mca_btl_udapl_eager_rdma_remote_t::head
uint8_t head
RDMA buffer to use.
Definition: btl_udapl_eager_rdma.h:40
mca_btl_udapl_eager_rdma_connect_t
Definition: btl_udapl_eager_rdma.h:50
mca_btl_udapl_reg_t
Definition: btl_udapl.h:159
mca_btl_udapl_eager_rdma_remote_t::lock
opal_mutex_t lock
protect access to RDMA buffer
Definition: btl_udapl_eager_rdma.h:43
mca_btl_udapl_control_header_t
Definition: btl_udapl_frag.h:52
mca_btl_udapl_eager_rdma_remote_t::rkey
DAT_RMR_CONTEXT rkey
key required to access remote memory
Definition: btl_udapl_eager_rdma.h:39
mca_btl_udapl_eager_rdma_local_t::lock
opal_mutex_t lock
protect access to RDMA buffer
Definition: btl_udapl_eager_rdma.h:29
mca_btl_udapl_eager_rdma_local_t::head
uint8_t head
RDMA buffer to poll.
Definition: btl_udapl_eager_rdma.h:26
mca_btl_udapl_eager_rdma_local_t
Definition: btl_udapl_eager_rdma.h:23
mca_btl_udapl_eager_rdma_local_t::base
ompi_ptr_t base
points to fragment structures
Definition: btl_udapl_eager_rdma.h:24
mca_btl_udapl_eager_rdma_credit_t
Definition: btl_udapl_eager_rdma.h:60