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-2006 The University of Tennessee and The University
7 * of Tennessee Research Foundation. All rights
8 * reserved.
9 * Copyright (c) 2004-2005 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) 2017 Research Organization for Information Science
16 * and Technology (RIST). All rights reserved.
17 * $COPYRIGHT$
18 *
19 * Additional copyrights may follow
20 *
21 * $HEADER$
22 */
23 /** @file:
24 *
25 * The Process Lifecycle Management (PLM) subsystem serves as the central
26 * switchyard for all process management activities, including
27 * resource allocation, process mapping, process launch, and process
28 * monitoring.
29 */
30
31 #ifndef ORTE_PLM_H
32 #define ORTE_PLM_H
33
34 /*
35 * includes
36 */
37
38 #include "orte_config.h"
39 #include "orte/types.h"
40
41 #include "orte/mca/mca.h"
42 #include "opal/dss/dss_types.h"
43 #include "opal/class/opal_pointer_array.h"
44
45 #include "orte/runtime/orte_globals.h"
46
47 #include "plm_types.h"
48
49 BEGIN_C_DECLS
50
51 /*
52 * Component functions - all MUST be provided
53 */
54
55 /*
56 * allow the selected module to initialize
57 */
58 typedef int (*orte_plm_base_module_init_fn_t)(void);
59
60 /*
61 * Spawn a job - this is a non-blocking function!
62 */
63 typedef int (*orte_plm_base_module_spawn_fn_t)(orte_job_t *jdata);
64
65 /*
66 * Remote spawn - spawn called by a daemon to launch a process on its own
67 */
68 typedef int (*orte_plm_base_module_remote_spawn_fn_t)(void);
69
70 /*
71 * Entry point to set the HNP name
72 */
73 typedef int (*orte_plm_base_module_set_hnp_name_fn_t)(void);
74
75 /**
76 * Cleanup resources held by module.
77 */
78
79 typedef int (*orte_plm_base_module_finalize_fn_t)(void);
80
81 /**
82 * Terminate any processes launched for the respective jobid by
83 * this component.
84 */
85 typedef int (*orte_plm_base_module_terminate_job_fn_t)(orte_jobid_t);
86
87 /**
88 * Terminate the daemons
89 */
90 typedef int (*orte_plm_base_module_terminate_orteds_fn_t)(void);
91
92 /**
93 * Terminate an array of specific procs
94 */
95 typedef int (*orte_plm_base_module_terminate_procs_fn_t)(opal_pointer_array_t *procs);
96
97 /**
98 * Signal any processes launched for the respective jobid by
99 * this component.
100 */
101 typedef int (*orte_plm_base_module_signal_job_fn_t)(orte_jobid_t, int32_t);
102
103 /**
104 * plm module version 1.0.0
105 */
106 struct orte_plm_base_module_1_0_0_t {
107 orte_plm_base_module_init_fn_t init;
108 orte_plm_base_module_set_hnp_name_fn_t set_hnp_name;
109 orte_plm_base_module_spawn_fn_t spawn;
110 orte_plm_base_module_remote_spawn_fn_t remote_spawn;
111 orte_plm_base_module_terminate_job_fn_t terminate_job;
112 orte_plm_base_module_terminate_orteds_fn_t terminate_orteds;
113 orte_plm_base_module_terminate_procs_fn_t terminate_procs;
114 orte_plm_base_module_signal_job_fn_t signal_job;
115 orte_plm_base_module_finalize_fn_t finalize;
116 };
117
118 /** shorten orte_plm_base_module_1_0_0_t declaration */
119 typedef struct orte_plm_base_module_1_0_0_t orte_plm_base_module_1_0_0_t;
120 /** shorten orte_plm_base_module_t declaration */
121 typedef struct orte_plm_base_module_1_0_0_t orte_plm_base_module_t;
122
123
124 /**
125 * plm component
126 */
127 struct orte_plm_base_component_2_0_0_t {
128 /** component version */
129 mca_base_component_t base_version;
130 /** component data */
131 mca_base_component_data_t base_data;
132 };
133 /** Convenience typedef */
134 typedef struct orte_plm_base_component_2_0_0_t orte_plm_base_component_2_0_0_t;
135 /** Convenience typedef */
136 typedef orte_plm_base_component_2_0_0_t orte_plm_base_component_t;
137
138
139 /**
140 * Macro for use in modules that are of type plm
141 */
142 #define ORTE_PLM_BASE_VERSION_2_0_0 \
143 ORTE_MCA_BASE_VERSION_2_1_0("plm", 2, 0, 0)
144
145 /* Global structure for accessing PLM functions */
146 ORTE_DECLSPEC extern orte_plm_base_module_t orte_plm; /* holds selected module's function pointers */
147
148 END_C_DECLS
149
150 #endif