This source file includes following definitions.
- rte_init
- rte_finalize
- env_set_name
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 #include "orte_config.h"
23 #include "orte/constants.h"
24
25 #include <sys/types.h>
26 #include <stdio.h>
27 #ifdef HAVE_FCNTL_H
28 #include <fcntl.h>
29 #endif
30 #ifdef HAVE_UNISTD_H
31 #include <unistd.h>
32 #endif
33 #include <stdlib.h>
34
35 #include "opal/mca/event/event.h"
36 #include "opal/runtime/opal.h"
37
38 #include "orte/util/show_help.h"
39 #include "orte/mca/mca.h"
40 #include "opal/mca/base/base.h"
41 #include "opal/mca/pmix/pmix.h"
42 #include "opal/util/output.h"
43 #include "opal/util/malloc.h"
44 #include "opal/util/argv.h"
45
46 #include "orte/mca/rml/base/base.h"
47 #include "orte/mca/rml/rml_types.h"
48 #include "orte/mca/routed/base/base.h"
49 #include "orte/mca/routed/routed.h"
50 #include "orte/mca/errmgr/base/base.h"
51 #include "orte/mca/grpcomm/base/base.h"
52 #include "orte/mca/iof/base/base.h"
53 #include "orte/mca/ess/base/base.h"
54 #include "orte/mca/ess/ess.h"
55 #include "orte/mca/ras/base/base.h"
56 #include "orte/mca/plm/base/base.h"
57
58 #include "orte/mca/rmaps/base/base.h"
59 #include "orte/mca/filem/base/base.h"
60 #include "orte/util/proc_info.h"
61 #include "orte/util/session_dir.h"
62 #include "orte/util/name_fns.h"
63
64 #include "orte/runtime/runtime.h"
65 #include "orte/runtime/orte_wait.h"
66 #include "orte/runtime/orte_globals.h"
67
68 #include "orte/mca/ess/ess.h"
69 #include "orte/mca/ess/base/base.h"
70 #include "orte/mca/ess/env/ess_env.h"
71
72 static int env_set_name(void);
73
74 static int rte_init(void);
75 static int rte_finalize(void);
76
77 orte_ess_base_module_t orte_ess_env_module = {
78 rte_init,
79 rte_finalize,
80 NULL,
81 NULL
82 };
83
84 static int rte_init(void)
85 {
86 int ret;
87 char *error = NULL;
88
89
90 if (ORTE_SUCCESS != (ret = orte_ess_base_std_prolog())) {
91 error = "orte_ess_base_std_prolog";
92 goto error;
93 }
94
95
96 env_set_name();
97
98
99
100
101 if (ORTE_SUCCESS != (ret = orte_ess_base_orted_setup())) {
102 ORTE_ERROR_LOG(ret);
103 error = "orte_ess_base_orted_setup";
104 goto error;
105 }
106 return ORTE_SUCCESS;
107
108 error:
109 if (ORTE_ERR_SILENT != ret && !orte_report_silent_errors) {
110 orte_show_help("help-orte-runtime.txt",
111 "orte_init:startup:internal-failure",
112 true, error, ORTE_ERROR_NAME(ret), ret);
113 }
114
115 return ret;
116 }
117
118 static int rte_finalize(void)
119 {
120 int ret;
121
122 if (ORTE_SUCCESS != (ret = orte_ess_base_orted_finalize())) {
123 ORTE_ERROR_LOG(ret);
124 }
125 return ret;
126 }
127
128 static int env_set_name(void)
129 {
130 int rc;
131 orte_jobid_t jobid;
132 orte_vpid_t vpid;
133
134 if (NULL == orte_ess_base_jobid) {
135 ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
136 return ORTE_ERR_NOT_FOUND;
137 }
138 if (ORTE_SUCCESS != (rc = orte_util_convert_string_to_jobid(&jobid, orte_ess_base_jobid))) {
139 ORTE_ERROR_LOG(rc);
140 return(rc);
141 }
142
143 if (NULL == orte_ess_base_vpid) {
144 ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
145 return ORTE_ERR_NOT_FOUND;
146 }
147 if (ORTE_SUCCESS != (rc = orte_util_convert_string_to_vpid(&vpid, orte_ess_base_vpid))) {
148 ORTE_ERROR_LOG(rc);
149 return(rc);
150 }
151
152 ORTE_PROC_MY_NAME->jobid = jobid;
153 ORTE_PROC_MY_NAME->vpid = vpid;
154
155 OPAL_OUTPUT_VERBOSE((1, orte_ess_base_framework.framework_output,
156 "ess:env set name to %s", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
157
158
159 if (ORTE_SUCCESS != (rc = orte_ess_env_get())) {
160 ORTE_ERROR_LOG(rc);
161 return rc;
162 }
163
164 return ORTE_SUCCESS;
165 }