This source file includes following definitions.
- mmap_runtime_query
- mmap_register
- mmap_open
- mmap_query
- mmap_close
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 #include "oshmem_config.h"
16
17 #include "opal/constants.h"
18
19 #include "oshmem/mca/sshmem/sshmem.h"
20 #include "oshmem/mca/sshmem/base/base.h"
21
22 #include "sshmem_mmap.h"
23
24
25
26
27 const char *mca_sshmem_mmap_component_version_string =
28 "OSHMEM mmap sshmem MCA component version " OSHMEM_VERSION;
29
30 int mca_sshmem_mmap_relocate_backing_file = 0;
31 char *mca_sshmem_mmap_backing_file_base_dir = NULL;
32 bool mca_sshmem_mmap_nfs_warning = true;
33
34
35
36
37 static int mmap_register(void);
38 static int mmap_open(void);
39 static int mmap_close(void);
40 static int mmap_query(mca_base_module_t **module, int *priority);
41 static int mmap_runtime_query(mca_base_module_t **module,
42 int *priority,
43 const char *hint);
44
45
46
47
48
49 mca_sshmem_mmap_component_t mca_sshmem_mmap_component = {
50
51
52
53 {
54
55
56
57 .base_version = {
58 MCA_SSHMEM_BASE_VERSION_2_0_0,
59
60
61 .mca_component_name = "mmap",
62 MCA_BASE_MAKE_VERSION(component, OSHMEM_MAJOR_VERSION, OSHMEM_MINOR_VERSION,
63 OSHMEM_RELEASE_VERSION),
64
65 .mca_open_component = mmap_open,
66 .mca_close_component = mmap_close,
67 .mca_query_component = mmap_query,
68 .mca_register_component_params = mmap_register,
69 },
70
71 .base_data = {
72
73 MCA_BASE_METADATA_PARAM_CHECKPOINT
74 },
75 .runtime_query = mmap_runtime_query,
76 },
77 };
78
79
80 static int
81 mmap_runtime_query(mca_base_module_t **module,
82 int *priority,
83 const char *hint)
84 {
85
86 *priority = mca_sshmem_mmap_component.priority;
87 *module = (mca_base_module_t *)&mca_sshmem_mmap_module.super;
88 return OPAL_SUCCESS;
89 }
90
91
92 static int
93 mmap_register(void)
94 {
95
96
97 mca_sshmem_mmap_component.priority = 40;
98 mca_base_component_var_register (&mca_sshmem_mmap_component.super.base_version,
99 "priority", "Priority for sshmem mmap "
100 "component (default: 40)", MCA_BASE_VAR_TYPE_INT,
101 NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
102 OPAL_INFO_LVL_3,
103 MCA_BASE_VAR_SCOPE_ALL_EQ,
104 &mca_sshmem_mmap_component.priority);
105
106 mca_sshmem_mmap_component.is_anonymous = 1;
107 mca_base_component_var_register (&mca_sshmem_mmap_component.super.base_version,
108 "anonymous", "Select whether anonymous sshmem is used for mmap "
109 "component (default: 1)", MCA_BASE_VAR_TYPE_INT,
110 NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
111 OPAL_INFO_LVL_4,
112 MCA_BASE_VAR_SCOPE_ALL_EQ,
113 &mca_sshmem_mmap_component.is_anonymous);
114
115 mca_sshmem_mmap_component.is_start_addr_fixed = 1;
116 mca_base_component_var_register (&mca_sshmem_mmap_component.super.base_version,
117 "fixed", "Select whether fixed start address is used for shmem "
118 "(default: 1)", MCA_BASE_VAR_TYPE_INT,
119 NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
120 OPAL_INFO_LVL_4,
121 MCA_BASE_VAR_SCOPE_ALL_EQ,
122 &mca_sshmem_mmap_component.is_start_addr_fixed);
123 return OSHMEM_SUCCESS;
124 }
125
126
127 static int
128 mmap_open(void)
129 {
130 return OSHMEM_SUCCESS;
131 }
132
133
134 static int
135 mmap_query(mca_base_module_t **module, int *priority)
136 {
137 *priority = mca_sshmem_mmap_component.priority;
138 *module = (mca_base_module_t *)&mca_sshmem_mmap_module.super;
139 return OSHMEM_SUCCESS;
140 }
141
142
143 static int
144 mmap_close(void)
145 {
146 return OSHMEM_SUCCESS;
147 }
148