This source file includes following definitions.
- plm_tm_register
- plm_tm_open
- plm_tm_close
- orte_plm_tm_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
24
25
26
27
28
29 #include "orte_config.h"
30 #include "orte/constants.h"
31
32 #include "opal/util/argv.h"
33
34
35 #include "orte/mca/plm/plm.h"
36 #include "orte/mca/plm/base/base.h"
37 #include "orte/mca/plm/base/plm_private.h"
38 #include "plm_tm.h"
39
40
41
42
43
44 const char *mca_plm_tm_component_version_string =
45 "Open MPI tm plm MCA component version " ORTE_VERSION;
46
47
48
49
50
51
52 static int plm_tm_register(void);
53 static int plm_tm_open(void);
54 static int plm_tm_close(void);
55 static int orte_plm_tm_component_query(mca_base_module_t **module, int *priority);
56
57
58
59
60
61
62
63 orte_plm_tm_component_t mca_plm_tm_component = {
64 {
65
66
67
68 .base_version = {
69 ORTE_PLM_BASE_VERSION_2_0_0,
70
71
72 .mca_component_name = "tm",
73 MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
74 ORTE_RELEASE_VERSION),
75
76
77 .mca_open_component = plm_tm_open,
78 .mca_close_component = plm_tm_close,
79 .mca_query_component = orte_plm_tm_component_query,
80 .mca_register_component_params = plm_tm_register,
81 },
82 .base_data = {
83
84 MCA_BASE_METADATA_PARAM_CHECKPOINT
85 },
86 }
87 };
88
89 static int plm_tm_register(void)
90 {
91 mca_base_component_t *comp = &mca_plm_tm_component.super.base_version;
92
93 mca_plm_tm_component.want_path_check = true;
94 (void) mca_base_component_var_register (comp, "want_path_check",
95 "Whether the launching process should check for the plm_tm_orted executable in the PATH before launching (the TM API does not give an indication of failure; this is a somewhat-lame workaround; non-zero values enable this check)",
96 MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
97 OPAL_INFO_LVL_9,
98 MCA_BASE_VAR_SCOPE_READONLY,
99 &mca_plm_tm_component.want_path_check);
100
101 return ORTE_SUCCESS;
102 }
103
104 static int plm_tm_open(void)
105 {
106 mca_plm_tm_component.checked_paths = NULL;
107
108 return ORTE_SUCCESS;
109 }
110
111
112 static int plm_tm_close(void)
113 {
114 if (NULL != mca_plm_tm_component.checked_paths) {
115 opal_argv_free(mca_plm_tm_component.checked_paths);
116 }
117
118 return ORTE_SUCCESS;
119 }
120
121
122 static int orte_plm_tm_component_query(mca_base_module_t **module, int *priority)
123 {
124
125
126 if (NULL != getenv("PBS_ENVIRONMENT") &&
127 NULL != getenv("PBS_JOBID")) {
128
129 *priority = 75;
130 *module = (mca_base_module_t *) &orte_plm_tm_module;
131 return ORTE_SUCCESS;
132 }
133
134
135 *module = NULL;
136 return ORTE_ERROR;
137 }