OpenMPI  0.1.1
crs_self.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2004-2009 The Trustees of Indiana University.
3  * All rights reserved.
4  * Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
5  * All rights reserved.
6  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
7  * University of Stuttgart. All rights reserved.
8  * Copyright (c) 2004-2005 The Regents of the University of California.
9  * All rights reserved.
10  * $COPYRIGHT$
11  *
12  * Additional copyrights may follow
13  *
14  * $HEADER$
15  */
16 
17 /**
18  * @file
19  *
20  * SELF CRS component
21  *
22  * Simple, braindead implementation.
23  */
24 
25 #ifndef MCA_CRS_SELF_EXPORT_H
26 #define MCA_CRS_SELF_EXPORT_H
27 
28 #include "opal_config.h"
29 
30 
31 #include "opal/mca/mca.h"
32 #include "opal/mca/crs/crs.h"
33 
34 BEGIN_C_DECLS
35 
36 #define PREFIX_DEFAULT ("opal_crs_self_user")
37 #define SUFFIX_CHECKPOINT ("checkpoint")
38 #define SUFFIX_CONTINUE ("continue")
39 #define SUFFIX_RESTART ("restart")
40 
41  typedef int (*opal_crs_self_checkpoint_callback_fn_t)(char **restart_cmd);
42  typedef int (*opal_crs_self_continue_callback_fn_t)(void);
43  typedef int (*opal_crs_self_restart_callback_fn_t)(void);
44 
45  /*
46  * Local Component structures
47  */
49  opal_crs_base_component_t super; /** Base CRS component */
50 
51  char *prefix; /** Prefix for user callbacks */
52  bool do_restart; /** Start by calling user restart routine in opal_init? */
53  bool can_checkpoint; /** If checkpointing is enabled */
54 
55  /** User defined functions */
56  opal_crs_self_checkpoint_callback_fn_t ucb_checkpoint_fn;
57  opal_crs_self_continue_callback_fn_t ucb_continue_fn;
58  opal_crs_self_restart_callback_fn_t ucb_restart_fn;
59  };
61  OPAL_MODULE_DECLSPEC extern opal_crs_self_component_t mca_crs_self_component;
62 
63  int opal_crs_self_component_query(mca_base_module_t **module, int *priority);
64 
65  /*
66  * Module functions
67  */
68  int opal_crs_self_module_init(void);
69  int opal_crs_self_module_finalize(void);
70 
71  /*
72  * Actual funcationality
73  */
74  int opal_crs_self_checkpoint( pid_t pid,
75  opal_crs_base_snapshot_t *snapshot,
77  opal_crs_state_type_t *state);
78 
79  int opal_crs_self_restart( opal_crs_base_snapshot_t *snapshot, bool spawn_child, pid_t *child_pid);
80 
81  int opal_crs_self_disable_checkpoint(void);
82  int opal_crs_self_enable_checkpoint(void);
83 
84  int opal_crs_self_prelaunch(int32_t rank,
85  char *base_snapshot_dir,
86  char **app,
87  char **cwd,
88  char ***argv,
89  char ***env);
90 
91  int opal_crs_self_reg_thread(void);
92 
93 
94 END_C_DECLS
95 
96 #endif /* MCA_CRS_SELF_EXPORT_H */
opal_crs_self_checkpoint_callback_fn_t ucb_checkpoint_fn
If checkpointing is enabled.
Definition: crs_self.h:56
bool can_checkpoint
Start by calling user restart routine in opal_init?
Definition: crs_self.h:53
Common type for all MCA modules.
Definition: mca.h:100
char * prefix
Base CRS component.
Definition: crs_self.h:51
Definition: crs_self.h:48
Top-level interface for all MCA components.
Structure for Single process snapshot Each component is assumed to have extened this definition in th...
Definition: crs.h:107
Structure for CRS components.
Definition: crs.h:248
Checkpoint and Restart Service (CRS) Interface.
bool do_restart
Prefix for user callbacks.
Definition: crs_self.h:52
opal_crs_state_type_t
States of the module.
Definition: crs.h:60