Skip to content

Commit

Permalink
Merge pull request #12882 from hppritcha/pr12870_for_v5.0.x
Browse files Browse the repository at this point in the history
ofi/common: fix code that broke sessions
  • Loading branch information
janjust authored Oct 30, 2024
2 parents 0f0ee22 + 56f49eb commit a4d90c8
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions opal/mca/common/ofi/common_ofi.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,10 @@ int opal_common_ofi_providers_subset_of_list(struct fi_info *provider_list, char

int opal_common_ofi_mca_register(const mca_base_component_t *component)
{
static int include_index = -1;
static int exclude_index = -1;
static int verbose_index = -1;
int include_index;
int exclude_index;
int verbose_index;
int param;
int ret;

if (fi_version() < FI_VERSION(1, 0)) {
Expand All @@ -332,7 +333,8 @@ int opal_common_ofi_mca_register(const mca_base_component_t *component)

OPAL_THREAD_LOCK(&opal_common_ofi_mutex);

if (0 > include_index) {
param = mca_base_var_find("opal", "opal_common", "ofi", "provider_include");
if (0 > param) {
/*
* this monkey business is needed because of the way the MCA VARs stuff tries to handle
* pointers to strings when when destructing the MCA var database. If you don't do
Expand All @@ -355,9 +357,12 @@ int opal_common_ofi_mca_register(const mca_base_component_t *component)
ret = include_index;
goto err;
}
} else {
include_index = param;
}

if (0 > exclude_index) {
param = mca_base_var_find("opal", "opal_common", "ofi", "provider_exclude");
if (0 > param) {
if (NULL == opal_common_ofi.prov_exclude) {
opal_common_ofi.prov_exclude = (char **) malloc(sizeof(char *));
assert(NULL != opal_common_ofi.prov_exclude);
Expand All @@ -374,9 +379,12 @@ int opal_common_ofi_mca_register(const mca_base_component_t *component)
ret = exclude_index;
goto err;
}
} else {
exclude_index = param;
}

if (0 > verbose_index) {
param = mca_base_var_find("opal", "opal_common", "ofi", "verbose");
if (0 > param) {
verbose_index = mca_base_var_register("opal", "opal_common", "ofi", "verbose",
"Verbose level of the OFI components",
MCA_BASE_VAR_TYPE_INT, NULL, 0,
Expand All @@ -387,6 +395,8 @@ int opal_common_ofi_mca_register(const mca_base_component_t *component)
ret = verbose_index;
goto err;
}
} else {
verbose_index = param;
}

if (component) {
Expand Down

0 comments on commit a4d90c8

Please sign in to comment.