This source file includes following definitions.
- mca_base_component_unload
- mca_base_component_close
- mca_base_framework_components_close
- mca_base_components_close
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 #include "opal_config.h"
23
24 #include "opal/class/opal_list.h"
25 #include "opal/util/output.h"
26 #include "opal/mca/mca.h"
27 #include "opal/mca/base/base.h"
28 #include "opal/mca/base/mca_base_component_repository.h"
29 #include "opal/constants.h"
30
31 void mca_base_component_unload (const mca_base_component_t *component, int output_id)
32 {
33 int ret;
34
35
36 opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id,
37 "mca: base: close: unloading component %s",
38 component->mca_component_name);
39
40 ret = mca_base_var_group_find (component->mca_project_name, component->mca_type_name,
41 component->mca_component_name);
42 if (0 <= ret) {
43 mca_base_var_group_deregister (ret);
44 }
45
46 mca_base_component_repository_release (component);
47 }
48
49 void mca_base_component_close (const mca_base_component_t *component, int output_id)
50 {
51
52 if (NULL != component->mca_close_component) {
53 if( OPAL_SUCCESS == component->mca_close_component() ) {
54 opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id,
55 "mca: base: close: component %s closed",
56 component->mca_component_name);
57 } else {
58 opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id,
59 "mca: base: close: component %s refused to close [drop it]",
60 component->mca_component_name);
61 return;
62 }
63 }
64
65 mca_base_component_unload (component, output_id);
66 }
67
68 int mca_base_framework_components_close (mca_base_framework_t *framework,
69 const mca_base_component_t *skip)
70 {
71 return mca_base_components_close (framework->framework_output,
72 &framework->framework_components,
73 skip);
74 }
75
76 int mca_base_components_close(int output_id, opal_list_t *components,
77 const mca_base_component_t *skip)
78 {
79 mca_base_component_list_item_t *cli, *next;
80
81
82
83
84
85
86 OPAL_LIST_FOREACH_SAFE(cli, next, components, mca_base_component_list_item_t) {
87 if (skip == cli->cli_component) {
88 continue;
89 }
90
91 mca_base_component_close (cli->cli_component, output_id);
92 opal_list_remove_item (components, &cli->super);
93
94 OBJ_RELEASE(cli);
95 }
96
97
98 return OPAL_SUCCESS;
99 }