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-2005 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) 2016 Intel, Inc. All rights reserved.
16 * $COPYRIGHT$
17 *
18 * Additional copyrights may follow
19 *
20 * $HEADER$
21 */
22 /**
23 * @file
24 *
25 * The OpenRTE Daemon's Local Launch Subsystem
26 *
27 */
28
29 #ifndef ORTE_MCA_ODLS_H
30 #define ORTE_MCA_ODLS_H
31
32 #include "orte_config.h"
33 #include "orte/types.h"
34
35 #include "orte/mca/mca.h"
36 #include "opal/class/opal_pointer_array.h"
37
38 #include "opal/dss/dss_types.h"
39 #include "orte/mca/rml/rml_types.h"
40 #include "orte/runtime/orte_globals.h"
41
42 #include "orte/mca/odls/odls_types.h"
43
44 BEGIN_C_DECLS
45
46 /*
47 * odls module functions
48 */
49
50 /*
51 * Construct a buffer for use in adding local processes
52 * In order to reuse daemons, we need a way for the HNP to construct a buffer that
53 * contains the data needed by the active ODLS component to launch a local process. Since the
54 * only one that knows what a particular ODLS component needs is that component, we require an
55 * entry point that the HNP can call to get the required buffer. This is constructed
56 * for *all* nodes - the individual orteds then parse that data to find the specific launch info
57 * for procs on their node
58 */
59 typedef int (*orte_odls_base_module_get_add_procs_data_fn_t)(opal_buffer_t *data,
60 orte_jobid_t job);
61
62 /**
63 * Locally launch the provided processes
64 */
65 typedef int (*orte_odls_base_module_launch_local_processes_fn_t)(opal_buffer_t *data);
66
67 /**
68 * Kill the local processes on this node
69 */
70 typedef int (*orte_odls_base_module_kill_local_processes_fn_t)(opal_pointer_array_t *procs);
71
72 /**
73 * Signal local processes
74 */
75 typedef int (*orte_odls_base_module_signal_local_process_fn_t)(const orte_process_name_t *proc,
76 int32_t signal);
77
78 /**
79 * Restart a local process
80 */
81 typedef int (*orte_odls_base_module_restart_proc_fn_t)(orte_proc_t *child);
82
83 /**
84 * pls module version
85 */
86 struct orte_odls_base_module_1_3_0_t {
87 orte_odls_base_module_get_add_procs_data_fn_t get_add_procs_data;
88 orte_odls_base_module_launch_local_processes_fn_t launch_local_procs;
89 orte_odls_base_module_kill_local_processes_fn_t kill_local_procs;
90 orte_odls_base_module_signal_local_process_fn_t signal_local_procs;
91 orte_odls_base_module_restart_proc_fn_t restart_proc;
92 };
93
94 /** shorten orte_odls_base_module_1_3_0_t declaration */
95 typedef struct orte_odls_base_module_1_3_0_t orte_odls_base_module_1_3_0_t;
96 /** shorten orte_odls_base_module_t declaration */
97 typedef struct orte_odls_base_module_1_3_0_t orte_odls_base_module_t;
98
99 /**
100 * odls component
101 */
102 struct orte_odls_base_component_2_0_0_t {
103 /** component version */
104 mca_base_component_t version;
105 /** component data */
106 mca_base_component_data_t base_data;
107 };
108 /** Convenience typedef */
109 typedef struct orte_odls_base_component_2_0_0_t orte_odls_base_component_2_0_0_t;
110 /** Convenience typedef */
111 typedef orte_odls_base_component_2_0_0_t orte_odls_base_component_t;
112
113
114 /**
115 * Macro for use in modules that are of type odls
116 */
117 #define ORTE_ODLS_BASE_VERSION_2_0_0 \
118 ORTE_MCA_BASE_VERSION_2_1_0("odls", 2, 0, 0)
119
120 /* Global structure for accessing ODLS functions
121 */
122 ORTE_DECLSPEC extern orte_odls_base_module_t orte_odls; /* holds selected module's function pointers */
123
124 END_C_DECLS
125
126 #endif /* MCA_ODLS_H */