Skip to content

Commit a4d90c8

Browse files
authored
Merge pull request #12882 from hppritcha/pr12870_for_v5.0.x
ofi/common: fix code that broke sessions
2 parents 0f0ee22 + 56f49eb commit a4d90c8

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

opal/mca/common/ofi/common_ofi.c

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,10 @@ int opal_common_ofi_providers_subset_of_list(struct fi_info *provider_list, char
321321

322322
int opal_common_ofi_mca_register(const mca_base_component_t *component)
323323
{
324-
static int include_index = -1;
325-
static int exclude_index = -1;
326-
static int verbose_index = -1;
324+
int include_index;
325+
int exclude_index;
326+
int verbose_index;
327+
int param;
327328
int ret;
328329

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

333334
OPAL_THREAD_LOCK(&opal_common_ofi_mutex);
334335

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

360-
if (0 > exclude_index) {
364+
param = mca_base_var_find("opal", "opal_common", "ofi", "provider_exclude");
365+
if (0 > param) {
361366
if (NULL == opal_common_ofi.prov_exclude) {
362367
opal_common_ofi.prov_exclude = (char **) malloc(sizeof(char *));
363368
assert(NULL != opal_common_ofi.prov_exclude);
@@ -374,9 +379,12 @@ int opal_common_ofi_mca_register(const mca_base_component_t *component)
374379
ret = exclude_index;
375380
goto err;
376381
}
382+
} else {
383+
exclude_index = param;
377384
}
378385

379-
if (0 > verbose_index) {
386+
param = mca_base_var_find("opal", "opal_common", "ofi", "verbose");
387+
if (0 > param) {
380388
verbose_index = mca_base_var_register("opal", "opal_common", "ofi", "verbose",
381389
"Verbose level of the OFI components",
382390
MCA_BASE_VAR_TYPE_INT, NULL, 0,
@@ -387,6 +395,8 @@ int opal_common_ofi_mca_register(const mca_base_component_t *component)
387395
ret = verbose_index;
388396
goto err;
389397
}
398+
} else {
399+
verbose_index = param;
390400
}
391401

392402
if (component) {

0 commit comments

Comments
 (0)