Skip to content

opal/common/ofi: do not compute device distances if process is unbound #11711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions opal/mca/common/ofi/common_ofi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -785,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
Expand Down Expand Up @@ -817,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;
Expand Down