1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
2 /*
3 * Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
4 * University Research and Technology
5 * Corporation. All rights reserved.
6 * Copyright (c) 2004-2011 The University of Tennessee and The University
7 * of Tennessee Research Foundation. All rights
8 * reserved.
9 * Copyright (c) 2004-2010 High Performance Computing Center Stuttgart,
10 * University of Stuttgart. All rights reserved.
11 * Copyright (c) 2004-2005 The Regents of the University of California.
12 * All rights reserved.
13 * Copyright (c) 2011-2015 Los Alamos National Security, LLC. All rights
14 * reserved.
15 * Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
16 * $COPYRIGHT$
17 *
18 * Additional copyrights may follow
19 *
20 * $HEADER$
21 */
22 /** @file:
23 *
24 * The OpenRTE Environment-Specific Services
25 *
26 */
27
28 #ifndef ORTE_ESS_H
29 #define ORTE_ESS_H
30
31 #include "orte_config.h"
32 #include "orte/types.h"
33
34 #include "orte/mca/mca.h"
35 #include "opal/mca/hwloc/base/base.h"
36
37 #include "orte/util/proc_info.h"
38 #include "orte/runtime/runtime.h"
39
40 BEGIN_C_DECLS
41
42 /*
43 * API functions
44 */
45
46 /*
47 * Initialize the RTE for this environment
48 */
49 typedef int (*orte_ess_base_module_init_fn_t)(void);
50
51 /*
52 * Finalize the RTE for this environment
53 */
54 typedef int (*orte_ess_base_module_finalize_fn_t)(void);
55
56 /**
57 * Abort the current application
58 *
59 * Aborts currently running application, NOTE: We do NOT call the
60 * regular C-library "abort" function, even
61 * though that would have alerted us to the fact that this is
62 * an abnormal termination, because it would automatically cause
63 * a core file to be generated. The "report" flag indicates if the
64 * function should create an appropriate file to alert the local
65 * orted that termination was abnormal.
66 */
67 typedef void (*orte_ess_base_module_abort_fn_t)(int status, bool report);
68
69 /**
70 * Handle fault tolerance updates
71 *
72 * @param[in] state Fault tolerance state update
73 *
74 * @retval ORTE_SUCCESS The operation completed successfully
75 * @retval ORTE_ERROR An unspecifed error occurred
76 */
77 typedef int (*orte_ess_base_module_ft_event_fn_t)(int state);
78
79 /*
80 * the standard module data structure
81 */
82 struct orte_ess_base_module_3_0_0_t {
83 orte_ess_base_module_init_fn_t init;
84 orte_ess_base_module_finalize_fn_t finalize;
85 orte_ess_base_module_abort_fn_t abort;
86 orte_ess_base_module_ft_event_fn_t ft_event;
87 };
88 typedef struct orte_ess_base_module_3_0_0_t orte_ess_base_module_3_0_0_t;
89 typedef struct orte_ess_base_module_3_0_0_t orte_ess_base_module_t;
90
91 /*
92 * the standard component data structure
93 */
94 struct orte_ess_base_component_2_0_0_t {
95 mca_base_component_t base_version;
96 mca_base_component_data_t base_data;
97 };
98 typedef struct orte_ess_base_component_2_0_0_t orte_ess_base_component_2_0_0_t;
99 typedef struct orte_ess_base_component_2_0_0_t orte_ess_base_component_t;
100
101 /*
102 * Macro for use in components that are of type ess
103 */
104 #define ORTE_ESS_BASE_VERSION_3_0_0 \
105 ORTE_MCA_BASE_VERSION_2_1_0("ess", 3, 0, 0)
106
107 /* Global structure for accessing ESS functions */
108 ORTE_DECLSPEC extern orte_ess_base_module_t orte_ess; /* holds selected module's function pointers */
109
110 END_C_DECLS
111
112 #endif