Skip to content

Commit 3347487

Browse files
authored
Merge pull request #5626 from hoopoepg/topic/opal-mem-hooks-syno-v4.0
MCA/COMMON/UCX: added synonim to opal_mem_hook variable - v4.0
2 parents 51e685f + 028bcb8 commit 3347487

File tree

6 files changed

+52
-17
lines changed

6 files changed

+52
-17
lines changed

ompi/mca/osc/ucx/osc_ucx_component.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ static int component_register(void) {
107107
MCA_BASE_VAR_SCOPE_GROUP, &mca_osc_ucx_component.priority);
108108
free(description_str);
109109

110+
opal_common_ucx_mca_var_register(&mca_osc_ucx_component.super.osc_version);
111+
110112
return OMPI_SUCCESS;
111113
}
112114

ompi/mca/pml/ucx/pml_ucx_component.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ static int mca_pml_ucx_component_register(void)
6464
OPAL_INFO_LVL_3,
6565
MCA_BASE_VAR_SCOPE_LOCAL,
6666
&ompi_pml_ucx.num_disconnect);
67+
opal_common_ucx_mca_var_register(&mca_pml_ucx_component.pmlm_version);
6768
return 0;
6869
}
6970

opal/mca/common/ucx/common_ucx.c

Lines changed: 44 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,50 @@ static void opal_common_ucx_mem_release_cb(void *buf, size_t length,
3434
ucm_vm_munmap(buf, length);
3535
}
3636

37+
OPAL_DECLSPEC void opal_common_ucx_mca_var_register(const mca_base_component_t *component)
38+
{
39+
static int registered = 0;
40+
static int hook_index;
41+
static int verbose_index;
42+
static int progress_index;
43+
if (!registered) {
44+
verbose_index = mca_base_var_register("opal", "opal_common", "ucx", "verbose",
45+
"Verbose level of the UCX components",
46+
MCA_BASE_VAR_TYPE_INT, NULL, 0,
47+
MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_3,
48+
MCA_BASE_VAR_SCOPE_LOCAL,
49+
&opal_common_ucx.verbose);
50+
progress_index = mca_base_var_register("opal", "opal_common", "ucx", "progress_iterations",
51+
"Set number of calls of internal UCX progress "
52+
"calls per opal_progress call",
53+
MCA_BASE_VAR_TYPE_INT, NULL, 0,
54+
MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_3,
55+
MCA_BASE_VAR_SCOPE_LOCAL,
56+
&opal_common_ucx.progress_iterations);
57+
hook_index = mca_base_var_register("opal", "opal_common", "ucx", "opal_mem_hooks",
58+
"Use OPAL memory hooks, instead of UCX internal "
59+
"memory hooks", MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
60+
OPAL_INFO_LVL_3,
61+
MCA_BASE_VAR_SCOPE_LOCAL,
62+
&opal_common_ucx.opal_mem_hooks);
63+
registered = 1;
64+
}
65+
if (component) {
66+
mca_base_var_register_synonym(verbose_index, component->mca_project_name,
67+
component->mca_type_name,
68+
component->mca_component_name,
69+
"verbose", 0);
70+
mca_base_var_register_synonym(progress_index, component->mca_project_name,
71+
component->mca_type_name,
72+
component->mca_component_name,
73+
"progress_iterations", 0);
74+
mca_base_var_register_synonym(hook_index, component->mca_project_name,
75+
component->mca_type_name,
76+
component->mca_component_name,
77+
"opal_mem_hooks", 0);
78+
}
79+
}
80+
3781
OPAL_DECLSPEC void opal_common_ucx_mca_register(void)
3882
{
3983
opal_common_ucx.registered++;
@@ -42,23 +86,6 @@ OPAL_DECLSPEC void opal_common_ucx_mca_register(void)
4286
return;
4387
}
4488

45-
mca_base_var_register("opal", "opal_common", "ucx", "verbose",
46-
"Verbose level of the UCX components",
47-
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
48-
OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_LOCAL,
49-
&opal_common_ucx.verbose);
50-
mca_base_var_register("opal", "opal_common", "ucx", "progress_iterations",
51-
"Set number of calls of internal UCX progress calls per opal_progress call",
52-
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
53-
OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_LOCAL,
54-
&opal_common_ucx.progress_iterations);
55-
mca_base_var_register("opal", "opal_common", "ucx", "opal_mem_hooks",
56-
"Use OPAL memory hooks, instead of UCX internal memory hooks",
57-
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
58-
OPAL_INFO_LVL_3,
59-
MCA_BASE_VAR_SCOPE_LOCAL,
60-
&opal_common_ucx.opal_mem_hooks);
61-
6289
opal_common_ucx.output = opal_output_open(NULL);
6390
opal_output_set_verbosity(opal_common_ucx.output, opal_common_ucx.verbose);
6491

opal/mca/common/ucx/common_ucx.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ OPAL_DECLSPEC void opal_common_ucx_mca_register(void);
6666
OPAL_DECLSPEC void opal_common_ucx_mca_deregister(void);
6767
OPAL_DECLSPEC void opal_common_ucx_empty_complete_cb(void *request, ucs_status_t status);
6868
OPAL_DECLSPEC int opal_common_ucx_mca_pmix_fence(ucp_worker_h worker);
69+
OPAL_DECLSPEC void opal_common_ucx_mca_var_register(const mca_base_component_t *component);
6970

7071
static inline
7172
int opal_common_ucx_wait_request(ucs_status_ptr_t request, ucp_worker_h worker,

oshmem/mca/atomic/ucx/atomic_ucx_component.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ static int ucx_register(void)
8686
MCA_BASE_VAR_SCOPE_ALL_EQ,
8787
&mca_atomic_ucx_component.priority);
8888

89+
opal_common_ucx_mca_var_register(&mca_atomic_ucx_component.atomic_version);
90+
8991
return OSHMEM_SUCCESS;
9092
}
9193

oshmem/mca/spml/ucx/spml_ucx_component.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ static int mca_spml_ucx_component_register(void)
104104
"Use non-blocking memory registration for shared heap",
105105
&mca_spml_ucx.heap_reg_nb);
106106

107+
opal_common_ucx_mca_var_register(&mca_spml_ucx_component.spmlm_version);
108+
107109
return OSHMEM_SUCCESS;
108110
}
109111

0 commit comments

Comments
 (0)