1
1

shmem base: this function had no purpose being public

Make it static to the base, and move it up higher in the file so that
multiple functions beneath it can call it.
Этот коммит содержится в:
Jeff Squyres 2015-02-26 14:03:13 -08:00
родитель 9666884cf1
Коммит 90a2c3cd99
2 изменённых файлов: 41 добавлений и 46 удалений

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

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007-2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2010-2011 Los Alamos National Security, LLC.
* All rights reserved.
* $COPYRIGHT$
@ -56,17 +56,6 @@ opal_shmem_unlink(opal_shmem_ds_t *ds_buf);
* Global functions for MCA overall shmem open and close
*/
/**
* Performs a run-time query across all available shmem components. Similar to
* mca_base_select, but take into consideration environment hints provided by
* orte.
*
* see: orte/mca/odls/base/odls_base_default_fns.c
*/
OPAL_DECLSPEC int
opal_shmem_base_runtime_query(mca_base_module_t **best_module,
mca_base_component_t **best_component);
/**
* returns the name of the best, runnable shmem component. the caller is
* responsible for freeing returned resources.

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

@ -40,41 +40,13 @@ const opal_shmem_base_component_2_0_0_t *opal_shmem_base_component = NULL;
const opal_shmem_base_module_2_0_0_t *opal_shmem_base_module = NULL;
/* ////////////////////////////////////////////////////////////////////////// */
char *
opal_shmem_base_best_runnable_component_name(void)
{
mca_base_component_t *best_component = NULL;
mca_base_module_t *best_module = NULL;
opal_output_verbose(10, opal_shmem_base_framework.framework_output,
"shmem: base: best_runnable_component_name: "
"Searching for best runnable component.");
/* select the best component so we can get its name. */
if (OPAL_SUCCESS != opal_shmem_base_runtime_query(&best_module,
&best_component)) {
/* fail! */
return NULL;
}
else {
if (NULL != best_component) {
opal_output_verbose(10, opal_shmem_base_framework.framework_output,
"shmem: base: best_runnable_component_name: "
"Found best runnable component: (%s).",
best_component->mca_component_name);
return strdup(best_component->mca_component_name);
}
else {
opal_output_verbose(10, opal_shmem_base_framework.framework_output,
"shmem: base: best_runnable_component_name: "
"Could not find runnable component.");
/* no component returned, so return NULL */
return NULL;
}
}
}
/* ////////////////////////////////////////////////////////////////////////// */
int
/*
* Performs a run-time query across all available shmem components.
* Similar to mca_base_select, but take into consideration environment
* hints provided by orte.
*/
static int
opal_shmem_base_runtime_query(mca_base_module_t **best_module,
mca_base_component_t **best_component)
{
@ -168,6 +140,40 @@ opal_shmem_base_runtime_query(mca_base_module_t **best_module,
return OPAL_SUCCESS;
}
/* ////////////////////////////////////////////////////////////////////////// */
char *
opal_shmem_base_best_runnable_component_name(void)
{
mca_base_component_t *best_component = NULL;
mca_base_module_t *best_module = NULL;
opal_output_verbose(10, opal_shmem_base_framework.framework_output,
"shmem: base: best_runnable_component_name: "
"Searching for best runnable component.");
/* select the best component so we can get its name. */
if (OPAL_SUCCESS != opal_shmem_base_runtime_query(&best_module,
&best_component)) {
/* fail! */
return NULL;
}
else {
if (NULL != best_component) {
opal_output_verbose(10, opal_shmem_base_framework.framework_output,
"shmem: base: best_runnable_component_name: "
"Found best runnable component: (%s).",
best_component->mca_component_name);
return strdup(best_component->mca_component_name);
}
else {
opal_output_verbose(10, opal_shmem_base_framework.framework_output,
"shmem: base: best_runnable_component_name: "
"Could not find runnable component.");
/* no component returned, so return NULL */
return NULL;
}
}
}
/* ////////////////////////////////////////////////////////////////////////// */
int
opal_shmem_base_select(void)