From 8d11393726c1dec02f73c58e7efba89f3f70c00e Mon Sep 17 00:00:00 2001 From: Edgar Gabriel Date: Mon, 29 Jul 2024 08:10:34 -0700 Subject: [PATCH 1/2] 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 --- .../rocm/accelerator_rocm_component.c | 58 ++++++++++++------- 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/opal/mca/accelerator/rocm/accelerator_rocm_component.c b/opal/mca/accelerator/rocm/accelerator_rocm_component.c index 4e3fb88e175..cf1c6c058b8 100644 --- a/opal/mca/accelerator/rocm/accelerator_rocm_component.c +++ b/opal/mca/accelerator/rocm/accelerator_rocm_component.c @@ -130,38 +130,52 @@ static int accelerator_rocm_close(void) static int accelerator_rocm_component_register(void) { + int var_id; + /* Set verbosity in the rocm related code. */ opal_accelerator_rocm_verbose = 0; - (void) mca_base_var_register("ompi", "mpi", "accelerator_rocm", "verbose", - "Set level of rocm verbosity", MCA_BASE_VAR_TYPE_INT, NULL, - 0, 0, OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY, - &opal_accelerator_rocm_verbose); + var_id = mca_base_component_var_register (&mca_accelerator_rocm_component.super.base_version, + "verbose", "Set level of verbosity of rocm component", + MCA_BASE_VAR_TYPE_INT, NULL, 0, + 0, OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY, + &opal_accelerator_rocm_verbose); + (void) mca_base_var_register_synonym (var_id, "ompi", "mpi", "accelerator_rocm", "verbose", + MCA_BASE_VAR_SYN_FLAG_DEPRECATED); /* Switching point between using memcpy and hipMemcpy* functions. */ opal_accelerator_rocm_memcpyD2H_limit = 1024; - (void) mca_base_var_register("ompi", "mpi", "accelerator_rocm", "memcpyD2H_limit", - "Max. msg. length to use memcpy instead of hip functions " - "for device-to-host copy operations", - MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, - OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY, - &opal_accelerator_rocm_memcpyD2H_limit); - + var_id = mca_base_component_var_register (&mca_accelerator_rocm_component.super.base_version, + "memcpyD2H_limit", + "Max. msg. length to use memcpy instead of hip functions " + "for device-to-host copy operations", + MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, + OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY, + &opal_accelerator_rocm_memcpyD2H_limit); + (void) mca_base_var_register_synonym (var_id, "ompi", "mpi", "accelerator_rocm", "memcpyD2H_limit", + MCA_BASE_VAR_SYN_FLAG_DEPRECATED); + /* Switching point between using memcpy and hipMemcpy* functions. */ opal_accelerator_rocm_memcpyH2D_limit = 1048576; - (void) mca_base_var_register("ompi", "mpi", "accelerator_rocm", "memcpyH2D_limit", - "Max. msg. length to use memcpy instead of hip functions " - "for host-to-device copy operations", - MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, - OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY, - &opal_accelerator_rocm_memcpyH2D_limit); + var_id = mca_base_component_var_register (&mca_accelerator_rocm_component.super.base_version, + "memcpyH2D_limit", + "Max. msg. length to use memcpy instead of hip functions " + "for host-to-device copy operations", + MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, + OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY, + &opal_accelerator_rocm_memcpyH2D_limit); + (void) mca_base_var_register_synonym (var_id, "ompi", "mpi", "accelerator_rocm", "memcpyH2D_limit", + MCA_BASE_VAR_SYN_FLAG_DEPRECATED); /* Use this flag to test async vs sync copies */ opal_accelerator_rocm_memcpy_async = 0; - (void) mca_base_var_register("ompi", "mpi", "accelerator_rocm", "memcpy_async", - "Set to 1 to force using hipMemcpyAsync instead of hipMemcpy", - MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, OPAL_INFO_LVL_9, - MCA_BASE_VAR_SCOPE_READONLY, &opal_accelerator_rocm_memcpy_async); - + var_id = mca_base_component_var_register (&mca_accelerator_rocm_component.super.base_version, + "memcpy_async", + "Set to 1 to force using hipMemcpyAsync instead of hipMemcpy", + MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, OPAL_INFO_LVL_9, + MCA_BASE_VAR_SCOPE_READONLY, + &opal_accelerator_rocm_memcpy_async); + (void) mca_base_var_register_synonym (var_id, "ompi", "mpi", "accelerator_rocm", "memcpy_async", + MCA_BASE_VAR_SYN_FLAG_DEPRECATED); return OPAL_SUCCESS; } From b44ecf0484f688c1de6ef8c34f63896bdcc38bb2 Mon Sep 17 00:00:00 2001 From: Edgar Gabriel Date: Tue, 30 Jul 2024 11:36:49 -0700 Subject: [PATCH 2/2] accelerator/ze: adjust parameter names make the same adjustments for the parameter names for ze as was done for rocm component, for the sake of consistency. The cuda componet does not register its parameters in the component itself, so this would be a bigger change. Signed-off-by: Edgar Gabriel --- opal/mca/accelerator/ze/accelerator_ze_component.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/opal/mca/accelerator/ze/accelerator_ze_component.c b/opal/mca/accelerator/ze/accelerator_ze_component.c index d34e2632a71..2a7aa985afe 100644 --- a/opal/mca/accelerator/ze/accelerator_ze_component.c +++ b/opal/mca/accelerator/ze/accelerator_ze_component.c @@ -110,12 +110,17 @@ static int accelerator_ze_close(void) static int accelerator_ze_component_register(void) { + int var_id; + /* Set verbosity in the ze related code. */ opal_accelerator_ze_verbose = 0; - (void) mca_base_var_register("ompi", "mpi", "accelerator_ze", "verbose", - "Set level of ze verbosity", MCA_BASE_VAR_TYPE_INT, NULL, - 0, 0, OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY, - &opal_accelerator_ze_verbose); + var_id = mca_base_component_var_register(&mca_accelerator_ze_component.super.base_version, + "verbose", "Set level of ze verbosity", + MCA_BASE_VAR_TYPE_INT, NULL, + 0, 0, OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY, + &opal_accelerator_ze_verbose); + (void) mca_base_var_register_synonym (var_id, "ompi", "mpi", "accelerator_ze", "verbose", + MCA_BASE_VAR_SYN_FLAG_DEPRECATED); return OPAL_SUCCESS; }