This source file includes following definitions.
- ras_sim_register
- ras_sim_component_query
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 #include "orte_config.h"
24 #include "orte/constants.h"
25
26 #include "opal/mca/base/base.h"
27 #include "opal/mca/if/if.h"
28
29 #include "orte/util/name_fns.h"
30 #include "orte/runtime/orte_globals.h"
31
32 #include "orte/mca/ras/base/ras_private.h"
33 #include "ras_sim.h"
34
35
36
37
38 static int ras_sim_register(void);
39 static int ras_sim_component_query(mca_base_module_t **module, int *priority);
40
41
42 orte_ras_sim_component_t mca_ras_simulator_component = {
43 {
44
45
46
47 .base_version = {
48 ORTE_RAS_BASE_VERSION_2_0_0,
49
50
51 .mca_component_name = "simulator",
52 MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
53 ORTE_RELEASE_VERSION),
54 .mca_query_component = ras_sim_component_query,
55 .mca_register_component_params = ras_sim_register,
56 },
57 .base_data = {
58
59 MCA_BASE_METADATA_PARAM_CHECKPOINT
60 },
61 }
62 };
63
64
65 static int ras_sim_register(void)
66 {
67 mca_base_component_t *component = &mca_ras_simulator_component.super.base_version;
68
69 mca_ras_simulator_component.slots = "1";
70 (void) mca_base_component_var_register (component, "slots",
71 "Comma-separated list of number of slots on each node to simulate",
72 MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
73 OPAL_INFO_LVL_9,
74 MCA_BASE_VAR_SCOPE_READONLY,
75 &mca_ras_simulator_component.slots);
76
77 mca_ras_simulator_component.slots_max = "0";
78 (void) mca_base_component_var_register (component, "max_slots",
79 "Comma-separated list of number of max slots on each node to simulate",
80 MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
81 OPAL_INFO_LVL_9,
82 MCA_BASE_VAR_SCOPE_READONLY,
83 &mca_ras_simulator_component.slots_max);
84 mca_ras_simulator_component.num_nodes = NULL;
85 (void) mca_base_component_var_register (component, "num_nodes",
86 "Comma-separated list of number of nodes to simulate for each topology",
87 MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
88 OPAL_INFO_LVL_9,
89 MCA_BASE_VAR_SCOPE_READONLY,
90 &mca_ras_simulator_component.num_nodes);
91 mca_ras_simulator_component.topofiles = NULL;
92 (void) mca_base_component_var_register (component, "topo_files",
93 "Comma-separated list of files containing xml topology descriptions for simulated nodes",
94 MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
95 OPAL_INFO_LVL_9,
96 MCA_BASE_VAR_SCOPE_READONLY,
97 &mca_ras_simulator_component.topofiles);
98 mca_ras_simulator_component.topologies = NULL;
99 (void) mca_base_component_var_register (component, "topologies",
100 "Comma-separated list of topology descriptions for simulated nodes",
101 MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
102 OPAL_INFO_LVL_9,
103 MCA_BASE_VAR_SCOPE_READONLY,
104 &mca_ras_simulator_component.topologies);
105 mca_ras_simulator_component.have_cpubind = true;
106 (void) mca_base_component_var_register (component, "have_cpubind",
107 "Topology supports binding to cpus",
108 MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
109 OPAL_INFO_LVL_9,
110 MCA_BASE_VAR_SCOPE_READONLY,
111 &mca_ras_simulator_component.have_cpubind);
112 mca_ras_simulator_component.have_membind = true;
113 (void) mca_base_component_var_register (component, "have_membind",
114 "Topology supports binding to memory",
115 MCA_BASE_VAR_TYPE_BOOL,NULL, 0, 0,
116 OPAL_INFO_LVL_9,
117 MCA_BASE_VAR_SCOPE_READONLY,
118 &mca_ras_simulator_component.have_membind);
119 return ORTE_SUCCESS;
120 }
121
122
123 static int ras_sim_component_query(mca_base_module_t **module, int *priority)
124 {
125 if (NULL != mca_ras_simulator_component.num_nodes) {
126 *module = (mca_base_module_t *) &orte_ras_sim_module;
127 *priority = 1000;
128
129 orte_do_not_launch = true;
130 opal_if_do_not_resolve = true;
131 return ORTE_SUCCESS;
132 }
133
134
135 *module = NULL;
136 *priority = 0;
137 return ORTE_ERROR;
138 }