Skip to content

Commit 8d11393

Browse files
committed
accelerator/rocm: adjust rocm mca parameter names
make the mca parameters of the accelerator/rocm component being recognized as parameters of the component, instead of generic mpi parameters. The original mca parameter names stem from the times when the rocm component was in mca/common/rocm/ instead of a component. We are however keeping the old names as synonyms, e.g. "accelerator_rocm_memcpy_async" (..., synonyms: mpi_accelerator_rocm_memcpy_async) Signed-off-by: Edgar Gabriel <[email protected]>
1 parent b4390af commit 8d11393

File tree

1 file changed

+36
-22
lines changed

1 file changed

+36
-22
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

0 commit comments

Comments
 (0)