1
1

shmem base: do not allow framework selection to occur twice

Both opal_shmem_base_select() and
opal_shmem_base_best_runnable_component_name() and were calling
opal_shmem_base_runtime_query(), which would do component selection
(and closing of losing components) twice.

Put protection in opal_shmem_base_runtime_query() to return the cached
results the second time.  Additionally, make
opal_shmem_base_runtime_query() "own" the cached results
(vs. opal_shmem_base_select).
Этот коммит содержится в:
Jeff Squyres 2015-02-26 14:04:53 -08:00
родитель 312b0afb67
Коммит 5215dc0db3

Просмотреть файл

@ -55,6 +55,15 @@ opal_shmem_base_runtime_query(mca_base_module_t **best_module,
mca_base_module_t *module = NULL;
int priority = 0, best_priority = INT32_MIN;
/* If we've already done this query, then just return the
results */
if (opal_shmem_base_selected) {
*best_component = &(opal_shmem_base_component->base_version);
*best_module = &(opal_shmem_base_module->base);
return OPAL_SUCCESS;
}
*best_module = NULL;
*best_component = NULL;
@ -137,6 +146,11 @@ opal_shmem_base_runtime_query(mca_base_module_t **best_module,
(void) mca_base_framework_components_close (&opal_shmem_base_framework,
(mca_base_component_t *)(*best_component));
/* save the winner */
opal_shmem_base_component = (opal_shmem_base_component_t*) *best_component;
opal_shmem_base_module = (opal_shmem_base_module_t*) *best_module;
opal_shmem_base_selected = true;
return OPAL_SUCCESS;
}
@ -190,11 +204,6 @@ opal_shmem_base_select(void)
return OPAL_ERROR;
}
/* save the winner */
opal_shmem_base_component = best_component;
opal_shmem_base_module = best_module;
opal_shmem_base_selected = true;
/* initialize the winner */
if (NULL != opal_shmem_base_module) {
return opal_shmem_base_module->module_init();