OpenMPI 0.1.1

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

- File List
- Globals

btl_self.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
3 * University Research and Technology
4 * Corporation. All rights reserved.
5 * Copyright (c) 2004-2009 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$
13 *
14 * Additional copyrights may follow
15 *
16 * $HEADER$
17 */
18 /**
19 * @file
20 */
21 #ifndef MCA_BTL_SELF_H
22 #define MCA_BTL_SELF_H
23
24 #include "ompi_config.h"
25
26 #ifdef HAVE_STDLIB_H
27 #include <stdlib.h>
28 #endif /* HAVE_STDLIB_H */
29 #ifdef HAVE_SYS_TYPES_H
30 #include <sys/types.h>
31 #endif /* HAVE_SYS_TYPES_H */
32 #include "opal/mca/event/event.h"
33 #include "ompi/class/ompi_free_list.h"
34 #include "ompi/mca/btl/btl.h"
35 #include "ompi/mca/btl/base/base.h"
36
37 BEGIN_C_DECLS
38
39 /**
40 * Shared Memory (SELF) BTL module.
41 */
42 struct mca_btl_self_component_t {
43 mca_btl_base_component_2_0_0_t super; /**< base BTL component */
44 int free_list_num; /**< initial size of free lists */
45 int free_list_max; /**< maximum size of free lists */
46 int free_list_inc; /**< number of elements to alloc when growing free lists */
47 opal_mutex_t self_lock;
48 ompi_free_list_t self_frags_eager; /**< free list of self first */
49 ompi_free_list_t self_frags_send; /**< free list of self second */
50 ompi_free_list_t self_frags_rdma; /**< free list of self second */
51 };
52 typedef struct mca_btl_self_component_t mca_btl_self_component_t;
53 OMPI_MODULE_DECLSPEC extern mca_btl_self_component_t mca_btl_self_component;
54
55 /**
56 * Register shared memory module parameters with the MCA framework
57 */
58 int mca_btl_self_component_open(void);
59
60 /**
61 * Any final cleanup before being unloaded.
62 */
63 int mca_btl_self_component_close(void);
64
65 /**
66 * SELF module initialization.
67 *
68 * @param num_btls (OUT) Number of BTLs returned in BTL array.
69 * @param enable_progress_threads (IN) Flag indicating whether BTL is allowed to have progress threads
70 * @param enable_mpi_threads (IN) Flag indicating whether BTL must support multilple simultaneous invocations from different threads
71 *
72 */
73 mca_btl_base_module_t** mca_btl_self_component_init(
74 int *num_btls,
75 bool enable_progress_threads,
76 bool enable_mpi_threads
77 );
78
79 extern mca_btl_base_module_t mca_btl_self;
80
81
82 /**
83 * Cleanup any resources held by the BTL.
84 *
85 * @param btl BTL instance.
86 * @return OMPI_SUCCESS or error status on failure.
87 */
88
89 int mca_btl_self_finalize(
90 struct mca_btl_base_module_t* btl
91 );
92
93
94 /**
95 * PML->BTL notification of change in the process list.
96 * PML->BTL Notification that a receive fragment has been matched.
97 * Called for message that is send from process with the virtual
98 * address of the shared memory segment being different than that of
99 * the receiver.
100 *
101 * @param btl (IN)
102 * @param proc (IN)
103 * @param peer (OUT)
104 * @return OMPI_SUCCESS or error status on failure.
105 *
106 */
107
108 int mca_btl_self_add_procs(
109 struct mca_btl_base_module_t* btl,
110 size_t nprocs,
111 struct ompi_proc_t **procs,
112 struct mca_btl_base_endpoint_t** peers,
113 struct opal_bitmap_t* reachability
114 );
115
116
117 /**
118 * PML->BTL notification of change in the process list.
119 *
120 * @param btl (IN) BTL instance
121 * @param proc (IN) Peer process
122 * @param peer (IN) Peer addressing information.
123 * @return Status indicating if cleanup was successful
124 *
125 */
126 int mca_btl_self_del_procs(
127 struct mca_btl_base_module_t* btl,
128 size_t nprocs,
129 struct ompi_proc_t **procs,
130 struct mca_btl_base_endpoint_t **peers
131 );
132
133
134 /**
135 * Allocate a segment.
136 *
137 * @param btl (IN) BTL module
138 * @param size (IN) Request segment size.
139 */
140 mca_btl_base_descriptor_t* mca_btl_self_alloc(
141 struct mca_btl_base_module_t* btl,
142 struct mca_btl_base_endpoint_t* endpoint,
143 uint8_t order,
144 size_t size,
145 uint32_t flags
146 );
147
148 /**
149 * Return a segment allocated by this BTL.
150 *
151 * @param btl (IN) BTL module
152 * @param segment (IN) Allocated segment.
153 */
154 int mca_btl_self_free(
155 struct mca_btl_base_module_t* btl,
156 mca_btl_base_descriptor_t* segment
157 );
158
159 /**
160 * Pack data
161 *
162 * @param btl (IN) BTL module
163 * @param peer (IN) BTL peer addressing
164 */
165 struct mca_btl_base_descriptor_t* mca_btl_self_prepare_src(
166 struct mca_btl_base_module_t* btl,
167 struct mca_btl_base_endpoint_t* endpoint,
168 struct mca_mpool_base_registration_t* registration,
169 struct opal_convertor_t* convertor,
170 uint8_t order,
171 size_t reserve,
172 size_t* size,
173 uint32_t flags
174 );
175
176 /**
177 * Prepare data for RDMA
178 *
179 * @param btl (IN) BTL module
180 * @param peer (IN) BTL peer addressing
181 */
182 struct mca_btl_base_descriptor_t* mca_btl_self_prepare_dst(
183 struct mca_btl_base_module_t* btl,
184 struct mca_btl_base_endpoint_t* endpoint,
185 struct mca_mpool_base_registration_t* registration,
186 struct opal_convertor_t* convertor,
187 uint8_t order,
188 size_t reserve,
189 size_t* size,
190 uint32_t flags
191 );
192
193 /**
194 * Initiate a send to the peer.
195 *
196 * @param btl (IN) BTL module
197 * @param peer (IN) BTL peer addressing
198 */
199 int mca_btl_self_send(
200 struct mca_btl_base_module_t* btl,
201 struct mca_btl_base_endpoint_t* endpoint,
202 struct mca_btl_base_descriptor_t* descriptor,
203 mca_btl_base_tag_t tag
204 );
205
206 /**
207 * Initiate a put to the peer.
208 *
209 * @param btl (IN) BTL module
210 * @param peer (IN) BTL peer addressing
211 */
212
213 int mca_btl_self_rdma(
214 struct mca_btl_base_module_t* btl,
215 struct mca_btl_base_endpoint_t* endpoint,
216 struct mca_btl_base_descriptor_t* descriptor
217 );
218
219 /**
220 * Fault Tolerance Event Notification Function
221 * @param state Checkpoint Stae
222 * @return OMPI_SUCCESS or failure status
223 */
224 int mca_btl_self_ft_event(int state);
225
226 END_C_DECLS
227
228 #endif
229
mca_btl_self_component_t::super
mca_btl_base_component_2_0_0_t super
base BTL component
Definition: btl_self.h:43
mca_btl_self_component_t::self_frags_rdma
ompi_free_list_t self_frags_rdma
free list of self second
Definition: btl_self.h:50
mca_btl_base_descriptor_t
A descriptor that holds the parameters to a send/put/get operation along w/ a callback routine that i...
Definition: btl.h:275
mca_btl_self_component_close
int mca_btl_self_component_close(void)
Any final cleanup before being unloaded.
Definition: btl_self_component.c:111
mca_btl_self_alloc
mca_btl_base_descriptor_t * mca_btl_self_alloc(struct mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *endpoint, uint8_t order, size_t size, uint32_t flags)
Allocate a segment.
Definition: btl_self.c:120
mca_btl_self_ft_event
int mca_btl_self_ft_event(int state)
Fault Tolerance Event Notification Function.
Definition: btl_self.c:392
opal_bitmap_t
Definition: opal_bitmap.h:53
mca_btl_self_add_procs
int mca_btl_self_add_procs(struct mca_btl_base_module_t *btl, size_t nprocs, struct ompi_proc_t **procs, struct mca_btl_base_endpoint_t **peers, struct opal_bitmap_t *reachability)
PML->BTL notification of change in the process list.
Definition: btl_self.c:68
mca_btl_self_finalize
int mca_btl_self_finalize(struct mca_btl_base_module_t *btl)
Cleanup any resources held by the BTL.
Definition: btl_self.c:108
opal_mutex_t
Definition: mutex_unix.h:53
mca_btl_self_del_procs
int mca_btl_self_del_procs(struct mca_btl_base_module_t *btl, size_t nprocs, struct ompi_proc_t **procs, struct mca_btl_base_endpoint_t **peers)
PML->BTL notification of change in the process list.
Definition: btl_self.c:86
mca_mpool_base_registration_t
Definition: mpool.h:44
ompi_proc_t
Remote Open MPI process structure.
Definition: proc.h:56
mca_btl_self_free
int mca_btl_self_free(struct mca_btl_base_module_t *btl, mca_btl_base_descriptor_t *segment)
Return a segment allocated by this BTL.
Definition: btl_self.c:151
mca_btl_self_component_t::free_list_inc
int free_list_inc
number of elements to alloc when growing free lists
Definition: btl_self.h:46
mca_btl_self_prepare_src
struct mca_btl_base_descriptor_t * mca_btl_self_prepare_src(struct mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *endpoint, struct mca_mpool_base_registration_t *registration, struct opal_convertor_t *convertor, uint8_t order, size_t reserve, size_t *size, uint32_t flags)
Pack data.
Definition: btl_self.c:178
mca_btl_self_component_t::free_list_num
int free_list_num
initial size of free lists
Definition: btl_self.h:44
btl.h
Byte Transfer Layer (BTL)
ompi_free_list_t
Definition: ompi_free_list.h:39
mca_btl_self_component_t
Shared Memory (SELF) BTL module.
Definition: btl_self.h:42
mca_btl_base_endpoint_t
State of ELAN endpoint connection.
Definition: btl_elan_endpoint.h:33
mca_btl_self_component_t::self_frags_eager
ompi_free_list_t self_frags_eager
free list of self first
Definition: btl_self.h:48
mca_btl_base_component_2_0_0_t
BTL component descriptor.
Definition: btl.h:411
opal_convertor_t
Definition: opal_convertor.h:90
mca_btl_self_send
int mca_btl_self_send(struct mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *endpoint, struct mca_btl_base_descriptor_t *descriptor, mca_btl_base_tag_t tag)
Initiate a send to the peer.
Definition: btl_self.c:281
mca_btl_base_descriptor_t::order
uint8_t order
order value, this is only valid in the local completion callback and may be used in subsequent calls ...
Definition: btl.h:292
mca_btl_self_component_init
mca_btl_base_module_t ** mca_btl_self_component_init(int *num_btls, bool enable_progress_threads, bool enable_mpi_threads)
SELF module initialization.
Definition: btl_self_component.c:124
base.h
mca_btl_self_component_open
int mca_btl_self_component_open(void)
Register shared memory module parameters with the MCA framework.
Definition: btl_self_component.c:72
mca_btl_self_rdma
int mca_btl_self_rdma(struct mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *endpoint, struct mca_btl_base_descriptor_t *descriptor)
Initiate a put to the peer.
Definition: btl_self.c:317
mca_btl_self_prepare_dst
struct mca_btl_base_descriptor_t * mca_btl_self_prepare_dst(struct mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *endpoint, struct mca_mpool_base_registration_t *registration, struct opal_convertor_t *convertor, uint8_t order, size_t reserve, size_t *size, uint32_t flags)
Prepare data for RDMA.
Definition: btl_self.c:246
mca_btl_base_module_t
BTL module interface functions and attributes.
Definition: btl.h:786
mca_btl_self_component_t::self_frags_send
ompi_free_list_t self_frags_send
free list of self second
Definition: btl_self.h:49
mca_btl_self_component_t::free_list_max
int free_list_max
maximum size of free lists
Definition: btl_self.h:45