This source file includes following definitions.
- orte_ras_gridengine_register
- orte_ras_gridengine_open
- orte_ras_gridengine_component_query
- orte_ras_gridengine_close
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 #include "orte_config.h"
29 #include "orte/constants.h"
30
31 #include "opal/mca/base/base.h"
32 #include "opal/util/output.h"
33
34 #include "orte/runtime/orte_globals.h"
35 #include "orte/util/name_fns.h"
36
37 #include "orte/mca/ras/base/ras_private.h"
38 #include "ras_gridengine.h"
39
40
41
42
43
44 static int orte_ras_gridengine_register(void);
45 static int orte_ras_gridengine_open(void);
46 static int orte_ras_gridengine_close(void);
47 static int orte_ras_gridengine_component_query(mca_base_module_t **module, int *priority);
48
49 static int orte_ras_gridengine_verbose;
50
51 orte_ras_gridengine_component_t mca_ras_gridengine_component = {
52 {
53
54
55
56 .base_version = {
57 ORTE_RAS_BASE_VERSION_2_0_0,
58 .mca_component_name = "gridengine",
59 MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
60 ORTE_RELEASE_VERSION),
61 .mca_open_component = orte_ras_gridengine_open,
62 .mca_close_component = orte_ras_gridengine_close,
63 .mca_query_component = orte_ras_gridengine_component_query,
64 .mca_register_component_params = orte_ras_gridengine_register,
65 },
66 .base_data = {
67
68 MCA_BASE_METADATA_PARAM_CHECKPOINT
69 },
70 }
71 };
72
73 static int orte_ras_gridengine_register(void)
74 {
75 mca_base_component_t *c = &mca_ras_gridengine_component.super.base_version;
76
77 mca_ras_gridengine_component.priority = 100;
78 (void) mca_base_component_var_register (c, "priority", "Priority of the gridengine ras component",
79 MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, OPAL_INFO_LVL_9,
80 MCA_BASE_VAR_SCOPE_READONLY, &mca_ras_gridengine_component.priority);
81
82 orte_ras_gridengine_verbose = 0;
83 (void) mca_base_component_var_register (c, "verbose",
84 "Enable verbose output for the gridengine ras component",
85 MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, OPAL_INFO_LVL_9,
86 MCA_BASE_VAR_SCOPE_LOCAL, &orte_ras_gridengine_verbose);
87
88 mca_ras_gridengine_component.show_jobid = false;
89 (void) mca_base_component_var_register (c, "show_jobid", "Show the JOB_ID of the Grid Engine job",
90 MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0, OPAL_INFO_LVL_9,
91 MCA_BASE_VAR_SCOPE_READONLY, &mca_ras_gridengine_component.show_jobid);
92
93 return ORTE_SUCCESS;
94 }
95
96
97
98
99 static int orte_ras_gridengine_open(void)
100 {
101 if (orte_ras_gridengine_verbose != 0) {
102 mca_ras_gridengine_component.verbose = opal_output_open(NULL);
103 } else {
104 mca_ras_gridengine_component.verbose = -1;
105 }
106
107 return ORTE_SUCCESS;
108 }
109
110 static int orte_ras_gridengine_component_query(mca_base_module_t **module, int *priority)
111 {
112 *priority = mca_ras_gridengine_component.priority;
113
114 if (NULL != getenv("SGE_ROOT") && NULL != getenv("ARC") &&
115 NULL != getenv("PE_HOSTFILE") && NULL != getenv("JOB_ID")) {
116 OPAL_OUTPUT_VERBOSE((2, orte_ras_base_framework.framework_output,
117 "%s ras:gridengine: available for selection",
118 ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
119 *module = (mca_base_module_t *) &orte_ras_gridengine_module;
120 return ORTE_SUCCESS;
121 }
122 OPAL_OUTPUT_VERBOSE((2, orte_ras_base_framework.framework_output,
123 "%s ras:gridengine: NOT available for selection",
124 ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
125 *module = NULL;
126 return ORTE_ERROR;
127 }
128
129
130
131
132 static int orte_ras_gridengine_close(void)
133 {
134 return ORTE_SUCCESS;
135 }