@@ -324,10 +324,11 @@ int opal_common_ofi_providers_subset_of_list(struct fi_info *provider_list, char
324
324
325
325
int opal_common_ofi_mca_register (const mca_base_component_t * component )
326
326
{
327
- static int include_index = -1 ;
328
- static int exclude_index = -1 ;
329
- static int verbose_index = -1 ;
330
- static int accelerator_rank_index = -1 ;
327
+ int include_index ;
328
+ int exclude_index ;
329
+ int verbose_index ;
330
+ int accelerator_rank_index ;
331
+ int param ;
331
332
int ret ;
332
333
333
334
if (fi_version () < FI_VERSION (1 , 0 )) {
@@ -336,7 +337,8 @@ int opal_common_ofi_mca_register(const mca_base_component_t *component)
336
337
337
338
OPAL_THREAD_LOCK (& opal_common_ofi_mutex );
338
339
339
- if (0 > include_index ) {
340
+ param = mca_base_var_find ("opal" , "opal_common" , "ofi" , "provider_include" );
341
+ if (0 > param ) {
340
342
/*
341
343
* this monkey business is needed because of the way the MCA VARs stuff tries to handle
342
344
* pointers to strings when when destructing the MCA var database. If you don't do
@@ -359,9 +361,12 @@ int opal_common_ofi_mca_register(const mca_base_component_t *component)
359
361
ret = include_index ;
360
362
goto err ;
361
363
}
364
+ } else {
365
+ include_index = param ;
362
366
}
363
367
364
- if (0 > exclude_index ) {
368
+ param = mca_base_var_find ("opal" , "opal_common" , "ofi" , "provider_exclude" );
369
+ if (0 > param ) {
365
370
if (NULL == opal_common_ofi .prov_exclude ) {
366
371
opal_common_ofi .prov_exclude = (char * * ) malloc (sizeof (char * ));
367
372
assert (NULL != opal_common_ofi .prov_exclude );
@@ -378,9 +383,12 @@ int opal_common_ofi_mca_register(const mca_base_component_t *component)
378
383
ret = exclude_index ;
379
384
goto err ;
380
385
}
386
+ } else {
387
+ exclude_index = param ;
381
388
}
382
389
383
- if (0 > verbose_index ) {
390
+ param = mca_base_var_find ("opal" , "opal_common" , "ofi" , "verbose" );
391
+ if (0 > param ) {
384
392
verbose_index = mca_base_var_register ("opal" , "opal_common" , "ofi" , "verbose" ,
385
393
"Verbose level of the OFI components" ,
386
394
MCA_BASE_VAR_TYPE_INT , NULL , 0 ,
@@ -391,9 +399,13 @@ int opal_common_ofi_mca_register(const mca_base_component_t *component)
391
399
ret = verbose_index ;
392
400
goto err ;
393
401
}
402
+ } else {
403
+ verbose_index = param ;
394
404
}
395
405
396
- if (0 > accelerator_rank_index ) {
406
+
407
+ param = mca_base_var_find ("opal" , "opal_common" , "ofi" , "accelerator_rank" );
408
+ if (0 > param ) {
397
409
accelerator_rank_index
398
410
= mca_base_var_register ("opal" , "opal_common" , "ofi" , "accelerator_rank" ,
399
411
"Process rank(non-negative) on the selected accelerator device" ,
@@ -404,6 +416,8 @@ int opal_common_ofi_mca_register(const mca_base_component_t *component)
404
416
ret = accelerator_rank_index ;
405
417
goto err ;
406
418
}
419
+ } else {
420
+ accelerator_rank_index = param ;
407
421
}
408
422
409
423
if (component ) {
0 commit comments