This source file includes following definitions.
- orte_finalize
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 #include "orte_config.h"
28 #include "orte/constants.h"
29
30 #include "opal/runtime/opal.h"
31 #include "opal/util/output.h"
32 #include "opal/util/argv.h"
33
34 #include "orte/mca/ess/ess.h"
35 #include "orte/mca/ess/base/base.h"
36 #include "orte/mca/schizo/base/base.h"
37 #include "orte/runtime/orte_globals.h"
38 #include "orte/runtime/runtime.h"
39 #include "orte/runtime/orte_locks.h"
40 #include "orte/util/listener.h"
41 #include "orte/util/name_fns.h"
42 #include "orte/util/proc_info.h"
43 #include "orte/util/show_help.h"
44
45 int orte_finalize(void)
46 {
47 int rc;
48
49 --orte_initialized;
50 if (0 != orte_initialized) {
51
52 if (0 > orte_initialized) {
53 opal_output(0, "%s MISMATCHED CALLS TO ORTE FINALIZE",
54 ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
55 }
56 return ORTE_ERROR;
57 }
58
59
60 if (opal_atomic_trylock(&orte_finalize_lock)) {
61 return ORTE_SUCCESS;
62 }
63
64
65 orte_finalizing = true;
66
67 if (ORTE_PROC_IS_HNP || ORTE_PROC_IS_DAEMON) {
68
69
70 orte_stop_listening();
71 }
72
73
74 orte_show_help_finalize();
75
76
77 if (ORTE_SUCCESS != (rc = orte_ess.finalize())) {
78 return rc;
79 }
80
81
82 (void) mca_base_framework_close(&orte_ess_base_framework);
83
84
85 orte_schizo.finalize();
86 (void) mca_base_framework_close(&orte_schizo_base_framework);
87
88
89 opal_output_close(orte_debug_output);
90
91 if (NULL != orte_fork_agent) {
92 opal_argv_free(orte_fork_agent);
93 }
94
95
96 OBJ_DESTRUCT(&orte_process_info.super);
97
98
99 rc = opal_finalize();
100
101 return rc;
102 }