OpenMPI  0.1.1
btl_udapl_frag.h
1 /*
2  * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
3  * University Research and Technology
4  * Corporation. All rights reserved.
5  * Copyright (c) 2004-2006 The University of Tennessee and The University
6  * of Tennessee Research Foundation. All rights
7  * reserved.
8  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9  * University of Stuttgart. All rights reserved.
10  * Copyright (c) 2004-2005 The Regents of the University of California.
11  * All rights reserved.
12  * Copyright (c) 2006 Sandia National Laboratories. All rights
13  * reserved.
14  * Copyright (c) 2007-2009 Sun Microsystems, Inc. All rights reserved.
15  *
16  * $COPYRIGHT$
17  *
18  * Additional copyrights may follow
19  *
20  * $HEADER$
21  */
22 
23 #ifndef MCA_BTL_UDAPL_FRAG_H
24 #define MCA_BTL_UDAPL_FRAG_H
25 
26 
27 #define MCA_BTL_UDAPL_FRAG_ALIGN (8)
28 #include "ompi_config.h"
29 
30 BEGIN_C_DECLS
31 
32 typedef enum {
33  MCA_BTL_UDAPL_SEND,
34  MCA_BTL_UDAPL_RECV,
35  MCA_BTL_UDAPL_PUT,
36  MCA_BTL_UDAPL_GET,
37  MCA_BTL_UDAPL_CONN_RECV,
38  MCA_BTL_UDAPL_CONN_SEND,
39  MCA_BTL_UDAPL_RDMA_WRITE,
40  MCA_BTL_UDAPL_FRAG_EAGER_RDMA,
41  MCA_BTL_UDAPL_IGNORE
42 } mca_btl_udapl_frag_type_t;
43 
44 typedef enum {
45  MCA_BTL_UDAPL_CONTROL_NOOP,
46  MCA_BTL_UDAPL_CONTROL_RDMA_CONNECT,
47  MCA_BTL_UDAPL_CONTROL_RDMA_CREDIT,
48  MCA_BTL_UDAPL_CONTROL_SR_CREDIT
49 } mca_btl_udapl_control_t;
50 
51 /* Control message header */
53  mca_btl_udapl_control_t type;
54 };
56 
57 /**
58  * uDAPL btl footer.
59  * This is put after the payload packet so the PML header can be aligned.
60  * Must be aligned on MCA_BTL_UDAPL_FRAG_ALIGN byte boundary.
61  */
63  mca_btl_base_tag_t tag;
64 };
66 
67 /**
68  * uDAPL BTL rdma footer.
69  * This is used in addtion to the uDAPL BTL footer. The two are seperate to
70  * allow for any padding that may be required between the two.
71  */
73  uint32_t size;
74  volatile uint8_t active;/* 0 = not in use; 1 = data is available to be
75  * received; this should always be the last entry
76  * in this structure
77  */
78  char pad[3]; /* pad out be aligned on MCA_BTL_UDAPL_FRAG_ALIGN byte boundary */
79 };
81 
82 /**
83  * uDAPL fragment derived type.
84  */
87  mca_btl_base_segment_t segment;
88 
89  struct mca_btl_udapl_module_t* btl;
90  struct mca_btl_base_endpoint_t* endpoint;
91  DAT_LMR_TRIPLET triplet;
92  struct mca_btl_udapl_reg_t* registration;
93 
96  size_t size;
97  mca_btl_udapl_frag_type_t type;
98  uint32_t pad; /* Padding the structure to be evenly divisble by MCA_BTL_UDAPL_FRAG_ALIGN */
99 };
102 
103 
106 
109 
112 
115 
116 
117 /*
118  * Macros to allocate/return descriptors from module specific
119  * free list(s).
120  */
121 
122 #define MCA_BTL_UDAPL_FRAG_ALLOC_EAGER(btl, frag, rc) \
123 { \
124  ompi_free_list_item_t *item; \
125  OMPI_FREE_LIST_GET(&((mca_btl_udapl_module_t*)btl)->udapl_frag_eager, item, rc); \
126  frag = (mca_btl_udapl_frag_t*) item; \
127 }
128 
129 #define MCA_BTL_UDAPL_FRAG_RETURN_EAGER(btl, frag) \
130 { \
131  OMPI_FREE_LIST_RETURN(&((mca_btl_udapl_module_t*)btl)->udapl_frag_eager, \
132  (ompi_free_list_item_t*)(frag)); \
133 }
134 
135 #define MCA_BTL_UDAPL_FRAG_ALLOC_EAGER_RECV(btl, frag, rc) \
136 { \
137  ompi_free_list_item_t *item; \
138  OMPI_FREE_LIST_GET(&((mca_btl_udapl_module_t*)btl)->udapl_frag_eager_recv, item, rc); \
139  frag = (mca_btl_udapl_frag_t*) item; \
140 }
141 
142 #define MCA_BTL_UDAPL_FRAG_ALLOC_MAX(btl, frag, rc) \
143 { \
144  ompi_free_list_item_t *item; \
145  OMPI_FREE_LIST_GET(&((mca_btl_udapl_module_t*)btl)->udapl_frag_max, item, rc); \
146  frag = (mca_btl_udapl_frag_t*) item; \
147 }
148 
149 #define MCA_BTL_UDAPL_FRAG_RETURN_MAX(btl, frag) \
150 { \
151  OMPI_FREE_LIST_RETURN(&((mca_btl_udapl_module_t*)btl)->udapl_frag_max, \
152  (ompi_free_list_item_t*)(frag)); \
153 }
154 
155 #define MCA_BTL_UDAPL_FRAG_ALLOC_MAX_RECV(btl, frag, rc) \
156 { \
157  ompi_free_list_item_t *item; \
158  OMPI_FREE_LIST_GET(&((mca_btl_udapl_module_t*)btl)->udapl_frag_max_recv, item, rc); \
159  frag = (mca_btl_udapl_frag_t*) item; \
160 }
161 
162 #define MCA_BTL_UDAPL_FRAG_ALLOC_USER(btl, frag, rc) \
163 { \
164  ompi_free_list_item_t *item; \
165  OMPI_FREE_LIST_GET(&((mca_btl_udapl_module_t*)btl)->udapl_frag_user, item, rc); \
166  frag = (mca_btl_udapl_frag_t*) item; \
167 }
168 
169 #define MCA_BTL_UDAPL_FRAG_RETURN_USER(btl, frag) \
170 { \
171  OMPI_FREE_LIST_RETURN(&((mca_btl_udapl_module_t*)btl)->udapl_frag_user, \
172  (ompi_free_list_item_t*)(frag)); \
173 }
174 
175 #define MCA_BTL_UDAPL_FRAG_ALLOC_CONTROL(btl, frag, rc) \
176 { \
177  ompi_free_list_item_t *item; \
178  OMPI_FREE_LIST_GET(&((mca_btl_udapl_module_t*)btl)->udapl_frag_control, item, rc); \
179  frag = (mca_btl_udapl_frag_t*) item; \
180 }
181 
182 #define MCA_BTL_UDAPL_FRAG_RETURN_CONTROL(btl, frag) \
183 { \
184  OMPI_FREE_LIST_RETURN(&((mca_btl_udapl_module_t*)btl)->udapl_frag_control, \
185  (ompi_free_list_item_t*)(frag)); \
186 }
187 
188 /*
189  * Calculate the pad value P required to align the given size S
190  */
191 #define MCA_BTL_UDAPL_FRAG_CALC_ALIGNMENT_PAD(P,S) do { \
192  (P) = ((S) % MCA_BTL_UDAPL_FRAG_ALIGN) == 0 ? \
193  0 : (MCA_BTL_UDAPL_FRAG_ALIGN - ((S) % MCA_BTL_UDAPL_FRAG_ALIGN)); \
194 } while (0);
195 
196 END_C_DECLS
197 #endif
A descriptor that holds the parameters to a send/put/get operation along w/ a callback routine that i...
Definition: btl.h:275
uDAPL fragment derived type.
Definition: btl_udapl_frag.h:85
Definition: btl_udapl.h:159
BTL Module Interface.
Definition: btl_udapl.h:106
Definition: btl_udapl_frag.h:52
State of ELAN endpoint connection.
Definition: btl_elan_endpoint.h:33
Describes a region/segment of memory that is addressable by an BTL.
Definition: btl.h:236
#define OBJ_CLASS_DECLARATION(NAME)
Declaration for class descriptor.
Definition: opal_object.h:236