Skip to content

Commit b5cab9b

Browse files
committed
accelerat/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 b5cab9b

File tree

1 file changed

+32
-22
lines changed

1 file changed

+32
-22
lines changed

opal/mca/accelerator/rocm/accelerator_rocm_component.c

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -130,38 +130,48 @@ 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", 0);
139143

140144
/* Switching point between using memcpy and hipMemcpy* functions. */
141145
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-
146+
var_id = mca_base_component_var_register (&mca_accelerator_rocm_component.super.base_version,
147+
"memcpyD2H_limit",
148+
"Max. msg. length to use memcpy instead of hip functions "
149+
"for device-to-host copy operations",
150+
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
151+
OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY,
152+
&opal_accelerator_rocm_memcpyD2H_limit);
153+
(void) mca_base_var_register_synonym (var_id, "ompi", "mpi", "accelerator_rocm", "memcpyD2H_limit", 0);
154+
149155
/* Switching point between using memcpy and hipMemcpy* functions. */
150156
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);
157+
var_id = mca_base_component_var_register (&mca_accelerator_rocm_component.super.base_version,
158+
"memcpyH2D_limit",
159+
"Max. msg. length to use memcpy instead of hip functions "
160+
"for host-to-device copy operations",
161+
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
162+
OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY,
163+
&opal_accelerator_rocm_memcpyH2D_limit);
164+
(void) mca_base_var_register_synonym (var_id, "ompi", "mpi", "accelerator_rocm", "memcpyH2D_limit", 0);
157165

158166
/* Use this flag to test async vs sync copies */
159167
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-
168+
var_id = mca_base_component_var_register (&mca_accelerator_rocm_component.super.base_version,
169+
"memcpy_async",
170+
"Set to 1 to force using hipMemcpyAsync instead of hipMemcpy",
171+
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, OPAL_INFO_LVL_9,
172+
MCA_BASE_VAR_SCOPE_READONLY,
173+
&opal_accelerator_rocm_memcpy_async);
174+
(void) mca_base_var_register_synonym (var_id, "ompi", "mpi", "accelerator_rocm", "memcpy_async", 0);
165175
return OPAL_SUCCESS;
166176
}
167177

0 commit comments

Comments
 (0)