This source file includes following definitions.
- mca_rcache_base_registration_constructor
- mca_rcache_base_close
- mca_rcache_base_open
- mca_rcache_base_register_mca_variables
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 #include "opal_config.h"
27 #include <stdio.h>
28
29 #include "opal/mca/mca.h"
30 #include "opal/mca/base/base.h"
31 #include "opal/mca/base/mca_base_pvar.h"
32 #include "opal/mca/rcache/rcache.h"
33 #include "opal/mca/rcache/base/base.h"
34 #include "opal/memoryhooks/memory.h"
35 #include "opal/constants.h"
36 #include "rcache_base_mem_cb.h"
37
38
39 #define STRINGIFYX(x) #x
40 #define STRINGIFY(x) STRINGIFYX(x)
41
42
43
44
45
46
47
48 #include "opal/mca/rcache/base/static-components.h"
49
50 int mca_rcache_base_used_mem_hooks = 0;
51
52
53
54
55
56 static void mca_rcache_base_registration_constructor( mca_rcache_base_registration_t * reg )
57 {
58 reg->rcache = NULL;
59 reg->base = NULL;
60 reg->bound = NULL;
61 reg->ref_count = 0;
62 reg->flags = 0;
63 }
64
65 OBJ_CLASS_INSTANCE(mca_rcache_base_registration_t, opal_free_list_item_t,
66 mca_rcache_base_registration_constructor, NULL);
67
68 #define TREE_ITEMS_MIN 2048
69 #define TREE_ITEMS_MAX 16384
70 #define TREE_ITEMS_INC 2048
71
72
73
74
75 opal_list_t mca_rcache_base_modules = {{0}};
76
77 OBJ_CLASS_INSTANCE(mca_rcache_base_selected_module_t, opal_list_item_t, NULL, NULL);
78
79 static int mca_rcache_base_close(void)
80 {
81 opal_list_item_t *item;
82 mca_rcache_base_selected_module_t *sm;
83
84
85
86 while (NULL != (item = opal_list_remove_first(&mca_rcache_base_modules))) {
87 sm = (mca_rcache_base_selected_module_t *) item;
88
89
90
91
92
93
94 if (NULL != sm->rcache_module->rcache_finalize) {
95 sm->rcache_module->rcache_finalize(sm->rcache_module);
96 }
97 OBJ_RELEASE(sm);
98 }
99
100
101 if (mca_rcache_base_used_mem_hooks) {
102 opal_mem_hooks_unregister_release(mca_rcache_base_mem_cb);
103
104
105
106
107
108
109 (void) mca_base_framework_close (&opal_memory_base_framework);
110 }
111
112
113
114 return mca_base_framework_components_close(&opal_rcache_base_framework, NULL);
115 }
116
117
118
119
120
121 static int mca_rcache_base_open(mca_base_open_flag_t flags)
122 {
123
124
125
126 OBJ_CONSTRUCT(&mca_rcache_base_modules, opal_list_t);
127
128
129 return mca_base_framework_components_open(&opal_rcache_base_framework, flags);
130 }
131
132 static int mca_rcache_base_register_mca_variables (mca_base_register_flag_t flags)
133 {
134 return OPAL_SUCCESS;
135 }
136
137 MCA_BASE_FRAMEWORK_DECLARE(opal, rcache, "OPAL Registration Cache",
138 mca_rcache_base_register_mca_variables,
139 mca_rcache_base_open, mca_rcache_base_close,
140 mca_rcache_base_static_components, 0);
141