Skip to content

Commit 3e03afa

Browse files
authored
Merge pull request #12721 from edgargabriel/topic/rocm-mca-parameters-fix
accelerator/rocm: adjust rocm mca parameter names
2 parents 1fcf4db + b44ecf0 commit 3e03afa

File tree

2 files changed

+45
-26
lines changed

2 files changed

+45
-26
lines changed

opal/mca/accelerator/rocm/accelerator_rocm_component.c

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -130,38 +130,52 @@ static int accelerator_rocm_close(void)
130130

131131
static int accelerator_rocm_component_register(void)
132132
{
133+
int var_id;
134+
133135
/* Set verbosity in the rocm related code. */
134136
opal_accelerator_rocm_verbose = 0;
135-
(void) mca_base_var_register("ompi", "mpi", "accelerator_rocm", "verbose",
136-
"Set level of rocm verbosity", MCA_BASE_VAR_TYPE_INT, NULL,
137-
0, 0, OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY,
138-
&opal_accelerator_rocm_verbose);
137+
var_id = mca_base_component_var_register (&mca_accelerator_rocm_component.super.base_version,
138+
"verbose", "Set level of verbosity of rocm component",
139+
MCA_BASE_VAR_TYPE_INT, NULL, 0,
140+
0, OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY,
141+
&opal_accelerator_rocm_verbose);
142+
(void) mca_base_var_register_synonym (var_id, "ompi", "mpi", "accelerator_rocm", "verbose",
143+
MCA_BASE_VAR_SYN_FLAG_DEPRECATED);
139144

140145
/* Switching point between using memcpy and hipMemcpy* functions. */
141146
opal_accelerator_rocm_memcpyD2H_limit = 1024;
142-
(void) mca_base_var_register("ompi", "mpi", "accelerator_rocm", "memcpyD2H_limit",
143-
"Max. msg. length to use memcpy instead of hip functions "
144-
"for device-to-host copy operations",
145-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
146-
OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY,
147-
&opal_accelerator_rocm_memcpyD2H_limit);
148-
147+
var_id = mca_base_component_var_register (&mca_accelerator_rocm_component.super.base_version,
148+
"memcpyD2H_limit",
149+
"Max. msg. length to use memcpy instead of hip functions "
150+
"for device-to-host copy operations",
151+
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
152+
OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY,
153+
&opal_accelerator_rocm_memcpyD2H_limit);
154+
(void) mca_base_var_register_synonym (var_id, "ompi", "mpi", "accelerator_rocm", "memcpyD2H_limit",
155+
MCA_BASE_VAR_SYN_FLAG_DEPRECATED);
156+
149157
/* Switching point between using memcpy and hipMemcpy* functions. */
150158
opal_accelerator_rocm_memcpyH2D_limit = 1048576;
151-
(void) mca_base_var_register("ompi", "mpi", "accelerator_rocm", "memcpyH2D_limit",
152-
"Max. msg. length to use memcpy instead of hip functions "
153-
"for host-to-device copy operations",
154-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
155-
OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY,
156-
&opal_accelerator_rocm_memcpyH2D_limit);
159+
var_id = mca_base_component_var_register (&mca_accelerator_rocm_component.super.base_version,
160+
"memcpyH2D_limit",
161+
"Max. msg. length to use memcpy instead of hip functions "
162+
"for host-to-device copy operations",
163+
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
164+
OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY,
165+
&opal_accelerator_rocm_memcpyH2D_limit);
166+
(void) mca_base_var_register_synonym (var_id, "ompi", "mpi", "accelerator_rocm", "memcpyH2D_limit",
167+
MCA_BASE_VAR_SYN_FLAG_DEPRECATED);
157168

158169
/* Use this flag to test async vs sync copies */
159170
opal_accelerator_rocm_memcpy_async = 0;
160-
(void) mca_base_var_register("ompi", "mpi", "accelerator_rocm", "memcpy_async",
161-
"Set to 1 to force using hipMemcpyAsync instead of hipMemcpy",
162-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, OPAL_INFO_LVL_9,
163-
MCA_BASE_VAR_SCOPE_READONLY, &opal_accelerator_rocm_memcpy_async);
164-
171+
var_id = mca_base_component_var_register (&mca_accelerator_rocm_component.super.base_version,
172+
"memcpy_async",
173+
"Set to 1 to force using hipMemcpyAsync instead of hipMemcpy",
174+
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, OPAL_INFO_LVL_9,
175+
MCA_BASE_VAR_SCOPE_READONLY,
176+
&opal_accelerator_rocm_memcpy_async);
177+
(void) mca_base_var_register_synonym (var_id, "ompi", "mpi", "accelerator_rocm", "memcpy_async",
178+
MCA_BASE_VAR_SYN_FLAG_DEPRECATED);
165179
return OPAL_SUCCESS;
166180
}
167181

opal/mca/accelerator/ze/accelerator_ze_component.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,17 @@ static int accelerator_ze_close(void)
110110

111111
static int accelerator_ze_component_register(void)
112112
{
113+
int var_id;
114+
113115
/* Set verbosity in the ze related code. */
114116
opal_accelerator_ze_verbose = 0;
115-
(void) mca_base_var_register("ompi", "mpi", "accelerator_ze", "verbose",
116-
"Set level of ze verbosity", MCA_BASE_VAR_TYPE_INT, NULL,
117-
0, 0, OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY,
118-
&opal_accelerator_ze_verbose);
117+
var_id = mca_base_component_var_register(&mca_accelerator_ze_component.super.base_version,
118+
"verbose", "Set level of ze verbosity",
119+
MCA_BASE_VAR_TYPE_INT, NULL,
120+
0, 0, OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY,
121+
&opal_accelerator_ze_verbose);
122+
(void) mca_base_var_register_synonym (var_id, "ompi", "mpi", "accelerator_ze", "verbose",
123+
MCA_BASE_VAR_SYN_FLAG_DEPRECATED);
119124

120125
return OPAL_SUCCESS;
121126
}

0 commit comments

Comments
 (0)