From 8e59e6717bde5677ff2acb07117438d5c36820e1 Mon Sep 17 00:00:00 2001 From: Wenduo Wang Date: Tue, 23 May 2023 01:23:36 +0000 Subject: [PATCH 1/2] opal/common/ofi: remove usage of deprecated macros PMIX_CPUSET_CONSTRUCT is deprecated. Remove its usage Signed-off-by: Wenduo Wang --- opal/mca/common/ofi/common_ofi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/opal/mca/common/ofi/common_ofi.c b/opal/mca/common/ofi/common_ofi.c index 761a41aeb2d..5a14c9132b7 100644 --- a/opal/mca/common/ofi/common_ofi.c +++ b/opal/mca/common/ofi/common_ofi.c @@ -472,12 +472,10 @@ static int compute_dev_distances(pmix_device_distance_t **distances, int ret = OPAL_SUCCESS; size_t ninfo; pmix_info_t *info; - pmix_cpuset_t cpuset; + pmix_cpuset_t cpuset = PMIX_CPUSET_STATIC_INIT; pmix_topology_t pmix_topo = PMIX_TOPOLOGY_STATIC_INIT; - pmix_device_type_t type = PMIX_DEVTYPE_OPENFABRICS | - PMIX_DEVTYPE_NETWORK; + pmix_device_type_t type = PMIX_DEVTYPE_OPENFABRICS | PMIX_DEVTYPE_NETWORK; - PMIX_CPUSET_CONSTRUCT(&cpuset); ret = PMIx_Get_cpuset(&cpuset, PMIX_CPUBIND_THREAD); if (PMIX_SUCCESS != ret) { /* we are not bound */ From e0061f4f9b32ab8570fb3fe548de6a27a44a141c Mon Sep 17 00:00:00 2001 From: Wenduo Wang Date: Tue, 23 May 2023 01:24:53 +0000 Subject: [PATCH 2/2] opal/common/ofi: skip distances calculation for unbound process If process is unbound there is no deterministic device distance Signed-off-by: Wenduo Wang --- opal/mca/common/ofi/common_ofi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opal/mca/common/ofi/common_ofi.c b/opal/mca/common/ofi/common_ofi.c index 5a14c9132b7..a80fc0eebb8 100644 --- a/opal/mca/common/ofi/common_ofi.c +++ b/opal/mca/common/ofi/common_ofi.c @@ -783,7 +783,7 @@ struct fi_info *opal_common_ofi_select_provider(struct fi_info *provider_list, struct fi_info **provider_table; #if OPAL_OFI_PCI_DATA_AVAILABLE pmix_device_distance_t *distances = NULL; - pmix_value_t *pmix_val; + pmix_value_t *pmix_val = NULL; struct fi_pci_attr pci; int num_distances = 0; #endif @@ -815,7 +815,7 @@ struct fi_info *opal_common_ofi_select_provider(struct fi_info *provider_list, /* find all the nearest devices to this thread, then out of these * determine which device we should bind to. */ - distances = get_nearest_nics(&num_distances, &pmix_val); + distances = process_info->proc_is_bound ? get_nearest_nics(&num_distances, &pmix_val) : NULL; #endif current_provider = provider;