OpenMPI  0.1.1
crcp.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
3  * University Research and Technology
4  * Corporation. All rights reserved.
5  * Copyright (c) 2004-2005 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  * Checkpoint/Restart Coordination Protocol (CRCP) Interface
22  *
23  */
24 
25 #ifndef MCA_CRCP_H
26 #define MCA_CRCP_H
27 
28 #include "ompi_config.h"
29 
30 #include "opal/mca/mca.h"
31 #include "opal/mca/base/base.h"
32 #include "opal/mca/crs/crs.h"
33 #include "opal/mca/crs/base/base.h"
34 
35 #include "opal/class/opal_object.h"
36 
37 #include "ompi/datatype/ompi_datatype.h"
38 #include "ompi/request/request.h"
39 
40 #include "ompi/class/ompi_free_list.h"
41 
42 #include "ompi/mca/pml/pml.h"
43 #include "ompi/mca/pml/base/base.h"
44 
45 #include "ompi/mca/btl/btl.h"
46 #include "ompi/mca/btl/base/base.h"
47 
48 BEGIN_C_DECLS
49 
50 /**
51  * Module initialization function.
52  * Returns OMPI_SUCCESS
53  */
55  (void);
56 
57 /**
58  * Module finalization function.
59  * Returns OMPI_SUCCESS
60  */
62  (void);
63 
64 
65 /************************
66  * MPI Quiesce Interface
67  ************************/
68 /**
69  * MPI_Quiesce_start component interface
70  */
72  (MPI_Info *info);
73 
74 /**
75  * MPI_Quiesce_end component interface
76  */
78  (MPI_Info *info);
79 
80 
81 /************************
82  * PML Wrapper hooks
83  * PML Wrapper is the CRCPW PML component
84  ************************/
85 /**
86  * To allow us to work before and after a PML command
87  */
89  OMPI_CRCP_PML_PRE,
90  OMPI_CRCP_PML_POST,
91  OMPI_CRCP_PML_SKIP,
92  OMPI_CRCP_PML_DONE
93 };
95 
99  int error_code;
100  mca_pml_base_component_t *wrapped_pml_component;
101  mca_pml_base_module_t *wrapped_pml_module;
102 };
105 
106 typedef ompi_crcp_base_pml_state_t* (*ompi_crcp_base_pml_enable_fn_t)
107  (bool enable, ompi_crcp_base_pml_state_t* );
108 
109 typedef ompi_crcp_base_pml_state_t* (*ompi_crcp_base_pml_add_comm_fn_t)
111 typedef ompi_crcp_base_pml_state_t* (*ompi_crcp_base_pml_del_comm_fn_t)
113 
114 typedef ompi_crcp_base_pml_state_t* (*ompi_crcp_base_pml_add_procs_fn_t)
115  ( struct ompi_proc_t **procs, size_t nprocs , ompi_crcp_base_pml_state_t*);
116 typedef ompi_crcp_base_pml_state_t* (*ompi_crcp_base_pml_del_procs_fn_t)
117  ( struct ompi_proc_t **procs, size_t nprocs , ompi_crcp_base_pml_state_t*);
118 
119 typedef ompi_crcp_base_pml_state_t* (*ompi_crcp_base_pml_progress_fn_t)
121 
122 typedef ompi_crcp_base_pml_state_t* (*ompi_crcp_base_pml_iprobe_fn_t)
123  (int dst, int tag, struct ompi_communicator_t* comm, int *matched,
125 
126 typedef ompi_crcp_base_pml_state_t* (*ompi_crcp_base_pml_probe_fn_t)
127  ( int dst, int tag, struct ompi_communicator_t* comm,
129 
130 typedef ompi_crcp_base_pml_state_t* (*ompi_crcp_base_pml_isend_init_fn_t)
131  ( void *buf, size_t count, ompi_datatype_t *datatype, int dst, int tag,
132  mca_pml_base_send_mode_t mode, struct ompi_communicator_t* comm,
134 
135 typedef ompi_crcp_base_pml_state_t* (*ompi_crcp_base_pml_isend_fn_t)
136  ( void *buf, size_t count, ompi_datatype_t *datatype, int dst, int tag,
137  mca_pml_base_send_mode_t mode, struct ompi_communicator_t* comm,
138  struct ompi_request_t **request, ompi_crcp_base_pml_state_t* );
139 
140 typedef ompi_crcp_base_pml_state_t* (*ompi_crcp_base_pml_send_fn_t)
141  ( void *buf, size_t count, ompi_datatype_t *datatype, int dst, int tag,
142  mca_pml_base_send_mode_t mode, struct ompi_communicator_t* comm,
144 
145 typedef ompi_crcp_base_pml_state_t* (*ompi_crcp_base_pml_irecv_init_fn_t)
146  ( void *buf, size_t count, ompi_datatype_t *datatype, int src, int tag,
147  struct ompi_communicator_t* comm, struct ompi_request_t **request,
149 
150 typedef ompi_crcp_base_pml_state_t* (*ompi_crcp_base_pml_irecv_fn_t)
151  ( void *buf, size_t count, ompi_datatype_t *datatype, int src, int tag,
152  struct ompi_communicator_t* comm, struct ompi_request_t **request,
154 
155 typedef ompi_crcp_base_pml_state_t* (*ompi_crcp_base_pml_recv_fn_t)
156  ( void *buf, size_t count, ompi_datatype_t *datatype, int src, int tag,
157  struct ompi_communicator_t* comm, ompi_status_public_t* status,
159 
160 typedef ompi_crcp_base_pml_state_t* (*ompi_crcp_base_pml_dump_fn_t)
161  ( struct ompi_communicator_t* comm, int verbose, ompi_crcp_base_pml_state_t* );
162 
163 typedef ompi_crcp_base_pml_state_t* (*ompi_crcp_base_pml_start_fn_t)
164  ( size_t count, ompi_request_t** requests, ompi_crcp_base_pml_state_t* );
165 
166 typedef ompi_crcp_base_pml_state_t* (*ompi_crcp_base_pml_ft_event_fn_t)
167  (int state, ompi_crcp_base_pml_state_t*);
168 
169 /* Request Interface */
170 typedef int (*ompi_crcp_base_request_complete_fn_t)
171  (struct ompi_request_t *request);
172 
173 /************************
174  * BTL Wrapper hooks
175  * JJH: Wrapper BTL not currently implemented.
176  ************************/
177 /**
178  * To allow us to work before and after a BTL command
179  */
181  OMPI_CRCP_BTL_PRE,
182  OMPI_CRCP_BTL_POST,
183  OMPI_CRCP_BTL_SKIP,
184  OMPI_CRCP_BTL_DONE
185 };
187 
189  ompi_free_list_item_t super;
191  int error_code;
193  mca_btl_base_component_t *wrapped_btl_component;
194  mca_btl_base_module_t *wrapped_btl_module;
195 };
198 
199 typedef ompi_crcp_base_btl_state_t* (*mca_crcp_base_btl_module_add_procs_fn_t)
200  ( struct mca_btl_base_module_t* btl,
201  size_t nprocs,
202  struct ompi_proc_t** procs,
203  struct mca_btl_base_endpoint_t** endpoints,
204  struct opal_bitmap_t* reachable,
206 
207 typedef ompi_crcp_base_btl_state_t* (*mca_crcp_base_btl_module_del_procs_fn_t)
208  ( struct mca_btl_base_module_t* btl,
209  size_t nprocs,
210  struct ompi_proc_t** procs,
211  struct mca_btl_base_endpoint_t**,
213 
214 typedef ompi_crcp_base_btl_state_t* (*mca_crcp_base_btl_module_register_fn_t)
215  ( struct mca_btl_base_module_t* btl,
216  mca_btl_base_tag_t tag,
218  void* cbdata,
220 
221 typedef ompi_crcp_base_btl_state_t* (*mca_crcp_base_btl_module_finalize_fn_t)
222  ( struct mca_btl_base_module_t* btl,
224 
225 typedef ompi_crcp_base_btl_state_t* (*mca_crcp_base_btl_module_alloc_fn_t)
226  ( struct mca_btl_base_module_t* btl,
227  size_t size,
229 
230 typedef ompi_crcp_base_btl_state_t* (*mca_crcp_base_btl_module_free_fn_t)
231  ( struct mca_btl_base_module_t* btl,
232  mca_btl_base_descriptor_t* descriptor,
234 
235 typedef ompi_crcp_base_btl_state_t* (*mca_crcp_base_btl_module_prepare_fn_t)
236  ( struct mca_btl_base_module_t* btl,
237  struct mca_btl_base_endpoint_t* endpoint,
238  mca_mpool_base_registration_t* registration,
239  struct opal_convertor_t* convertor,
240  size_t reserve,
241  size_t* size,
243 
244 typedef ompi_crcp_base_btl_state_t* (*mca_crcp_base_btl_module_send_fn_t)
245  ( struct mca_btl_base_module_t* btl,
246  struct mca_btl_base_endpoint_t* endpoint,
247  struct mca_btl_base_descriptor_t* descriptor,
248  mca_btl_base_tag_t tag,
250 
251 typedef ompi_crcp_base_btl_state_t* (*mca_crcp_base_btl_module_put_fn_t)
252  ( struct mca_btl_base_module_t* btl,
253  struct mca_btl_base_endpoint_t* endpoint,
254  struct mca_btl_base_descriptor_t* descriptor,
256 
257 typedef ompi_crcp_base_btl_state_t* (*mca_crcp_base_btl_module_get_fn_t)
258  ( struct mca_btl_base_module_t* btl,
259  struct mca_btl_base_endpoint_t* endpoint,
260  struct mca_btl_base_descriptor_t* descriptor,
262 
263 typedef ompi_crcp_base_btl_state_t* (*mca_crcp_base_btl_module_dump_fn_t)
264  ( struct mca_btl_base_module_t* btl,
265  struct mca_btl_base_endpoint_t* endpoint,
266  int verbose,
268 
269 typedef ompi_crcp_base_btl_state_t* (*mca_crcp_base_btl_module_ft_event_fn_t)
270  (int state,
272 
273 
274 /**
275  * Structure for CRCP components.
276  */
278  /** MCA base component */
280  /** MCA base data */
282 
283  /** Verbosity Level */
284  int verbose;
285  /** Output Handle for opal_output */
287  /** Default Priority */
288  int priority;
289 
290 };
293 
294 /**
295  * Structure for CRCP modules
296  */
298  /** Initialization Function */
300  /** Finalization Function */
302 
303  /**< MPI_Quiesce Interface Functions ******************/
304  ompi_crcp_base_quiesce_start_fn_t quiesce_start;
306 
307  /**< PML Wrapper Functions ****************************/
308  ompi_crcp_base_pml_enable_fn_t pml_enable;
309 
310  ompi_crcp_base_pml_add_comm_fn_t pml_add_comm;
311  ompi_crcp_base_pml_del_comm_fn_t pml_del_comm;
312 
313  ompi_crcp_base_pml_add_procs_fn_t pml_add_procs;
314  ompi_crcp_base_pml_del_procs_fn_t pml_del_procs;
315 
316  ompi_crcp_base_pml_progress_fn_t pml_progress;
317 
318  ompi_crcp_base_pml_iprobe_fn_t pml_iprobe;
319  ompi_crcp_base_pml_probe_fn_t pml_probe;
320 
321  ompi_crcp_base_pml_isend_init_fn_t pml_isend_init;
322  ompi_crcp_base_pml_isend_fn_t pml_isend;
323  ompi_crcp_base_pml_send_fn_t pml_send;
324 
325  ompi_crcp_base_pml_irecv_init_fn_t pml_irecv_init;
326  ompi_crcp_base_pml_irecv_fn_t pml_irecv;
327  ompi_crcp_base_pml_recv_fn_t pml_recv;
328 
329  ompi_crcp_base_pml_dump_fn_t pml_dump;
330  ompi_crcp_base_pml_start_fn_t pml_start;
331 
332  ompi_crcp_base_pml_ft_event_fn_t pml_ft_event;
333 
334  /**< Request complete Function ****************************/
335  ompi_crcp_base_request_complete_fn_t request_complete;
336 
337  /**< BTL Wrapper Functions ****************************/
338  mca_crcp_base_btl_module_add_procs_fn_t btl_add_procs;
339  mca_crcp_base_btl_module_del_procs_fn_t btl_del_procs;
340 
341  mca_crcp_base_btl_module_register_fn_t btl_register;
342  mca_crcp_base_btl_module_finalize_fn_t btl_finalize;
343 
344  mca_crcp_base_btl_module_alloc_fn_t btl_alloc;
345  mca_crcp_base_btl_module_free_fn_t btl_free;
346 
347  mca_crcp_base_btl_module_prepare_fn_t btl_prepare_src;
348  mca_crcp_base_btl_module_prepare_fn_t btl_prepare_dst;
349 
350  mca_crcp_base_btl_module_send_fn_t btl_send;
351  mca_crcp_base_btl_module_put_fn_t btl_put;
352  mca_crcp_base_btl_module_get_fn_t btl_get;
353 
354  mca_crcp_base_btl_module_dump_fn_t btl_dump;
355 
356  mca_crcp_base_btl_module_ft_event_fn_t btl_ft_event;
357 };
360 
361 OMPI_DECLSPEC extern ompi_crcp_base_module_t ompi_crcp;
362 
363 /**
364  * Macro for use in components that are of type CRCP
365  */
366 #define OMPI_CRCP_BASE_VERSION_2_0_0 \
367  MCA_BASE_VERSION_2_0_0, \
368  "crcp", 2, 0, 0
369 
370 /**
371  * Macro to call the CRCP Request Complete function
372  */
373 #if OPAL_ENABLE_FT_CR == 1
374 #define OMPI_CRCP_REQUEST_COMPLETE(req) \
375  if( NULL != ompi_crcp.request_complete) { \
376  ompi_crcp.request_complete(req); \
377  }
378 #else
379 #define OMPI_CRCP_REQUEST_COMPLETE(req) ;
380 #endif
381 
382 END_C_DECLS
383 
384 #endif /* OMPI_CRCP_H */
int output_handle
Output Handle for opal_output.
Definition: crcp.h:286
Common type for all MCA components.
Definition: mca.h:250
A descriptor that holds the parameters to a send/put/get operation along w/ a callback routine that i...
Definition: btl.h:275
ompi_crcp_base_quiesce_end_fn_t quiesce_end
PML Wrapper Functions.
Definition: crcp.h:305
Definition: crcp.h:96
P2P Management Layer (PML)
void(* mca_btl_base_module_recv_cb_fn_t)(struct mca_btl_base_module_t *btl, mca_btl_base_tag_t tag, mca_btl_base_descriptor_t *descriptor, void *cbdata)
Callback function that is called asynchronously on receipt of data by the transport layer...
Definition: btl.h:391
Definition: opal_bitmap.h:53
int priority
Default Priority.
Definition: crcp.h:288
Definition: ompi_datatype.h:68
int(* ompi_crcp_base_quiesce_start_fn_t)(MPI_Info *info)
MPI_Quiesce_start component interface.
Definition: crcp.h:72
int(* ompi_crcp_base_module_finalize_fn_t)(void)
Module finalization function.
Definition: crcp.h:62
ompi_crcp_base_request_complete_fn_t request_complete
BTL Wrapper Functions.
Definition: crcp.h:335
ompi_crcp_base_module_finalize_fn_t crcp_finalize
Finalization Function.
Definition: crcp.h:301
ompi_crcp_base_module_init_fn_t crcp_init
Initialization Function.
Definition: crcp.h:299
Definition: crcp.h:188
PML component version and interface functions.
Definition: pml.h:131
mca_base_component_t base_version
MCA base component.
Definition: crcp.h:279
Definition: mpool.h:44
Remote Open MPI process structure.
Definition: proc.h:56
int verbose
Verbosity Level.
Definition: crcp.h:284
int(* ompi_crcp_base_quiesce_end_fn_t)(MPI_Info *info)
MPI_Quiesce_end component interface.
Definition: crcp.h:78
Top-level interface for all MCA components.
Definition: info.h:38
Structure for CRCP modules.
Definition: crcp.h:297
Top-level description of requests.
Byte Transfer Layer (BTL)
PML instance.
Definition: pml.h:512
mca_base_component_data_t base_data
MCA base data.
Definition: crcp.h:281
State of ELAN endpoint connection.
Definition: btl_elan_endpoint.h:33
Definition: ompi_free_list.h:62
BTL component descriptor.
Definition: btl.h:411
Definition: opal_convertor.h:90
Structure for CRCP components.
Definition: crcp.h:277
Meta data for MCA v2.0.0 components.
Definition: mca.h:309
ompi_crcp_base_pml_ft_event_fn_t pml_ft_event
Request complete Function.
Definition: crcp.h:332
Definition: mpi.h:337
Definition: evdns.c:158
Checkpoint and Restart Service (CRS) Interface.
BTL module interface functions and attributes.
Definition: btl.h:786
ompi_crcp_base_btl_states_t
To allow us to work before and after a BTL command.
Definition: crcp.h:180
BEGIN_C_DECLS typedef int(* ompi_crcp_base_module_init_fn_t)(void)
Module initialization function.
Definition: crcp.h:55
A simple C-language object-oriented system with single inheritance and ownership-based memory managem...
Definition: communicator.h:118
ompi_crcp_base_pml_states_t
To allow us to work before and after a PML command.
Definition: crcp.h:88
Main top-level request struct definition.
Definition: request.h:100
#define OBJ_CLASS_DECLARATION(NAME)
Declaration for class descriptor.
Definition: opal_object.h:236