This source file includes following definitions.
- orte_rtc_base_close
- orte_rtc_base_open
- mdes
- rcon
- rdes
1
2
3
4
5
6
7
8
9
10
11
12 #include "orte_config.h"
13 #include "orte/constants.h"
14
15 #include <string.h>
16
17 #include "orte/mca/mca.h"
18 #include "opal/class/opal_list.h"
19 #include "opal/mca/base/base.h"
20
21 #include "orte/mca/rtc/base/base.h"
22
23
24
25
26
27
28 #include "orte/mca/rtc/base/static-components.h"
29
30
31
32
33 orte_rtc_API_module_t orte_rtc = {
34 orte_rtc_base_assign,
35 orte_rtc_base_set,
36 orte_rtc_base_get_avail_vals
37 };
38 orte_rtc_base_t orte_rtc_base = {{{0}}};
39
40 static int orte_rtc_base_close(void)
41 {
42 opal_list_item_t *item;
43
44
45 while (NULL != (item = opal_list_remove_first(&orte_rtc_base.actives))) {
46 OBJ_RELEASE(item);
47 }
48 OBJ_DESTRUCT(&orte_rtc_base.actives);
49
50 return mca_base_framework_components_close(&orte_rtc_base_framework, NULL);
51 }
52
53
54
55
56
57 static int orte_rtc_base_open(mca_base_open_flag_t flags)
58 {
59
60 OBJ_CONSTRUCT(&orte_rtc_base.actives, opal_list_t);
61
62
63 return mca_base_framework_components_open(&orte_rtc_base_framework, flags);
64 }
65
66 MCA_BASE_FRAMEWORK_DECLARE(orte, rtc, "ORTE Mapping Subsystem",
67 NULL, orte_rtc_base_open, orte_rtc_base_close,
68 mca_rtc_base_static_components, 0);
69
70 static void mdes(orte_rtc_base_selected_module_t *active)
71 {
72 if (NULL != active->module->finalize) {
73 active->module->finalize();
74 }
75 }
76 OBJ_CLASS_INSTANCE(orte_rtc_base_selected_module_t,
77 opal_list_item_t,
78 NULL, mdes);
79
80 static void rcon(orte_rtc_resource_t *p)
81 {
82 p->component = NULL;
83 p->category = NULL;
84 OBJ_CONSTRUCT(&p->control, opal_value_t);
85 }
86 static void rdes(orte_rtc_resource_t *p)
87 {
88 if (NULL != p->component) {
89 free(p->component);
90 }
91 if (NULL != p->category) {
92 free(p->category);
93 }
94 OBJ_DESTRUCT(&p->control);
95 }
96 OBJ_CLASS_INSTANCE(orte_rtc_resource_t,
97 opal_list_item_t,
98 rcon, rdes);