1
1

Nothing of substance; just indenting changes (''finally'' update this

framework base to 4 space tabs!).

This commit was SVN r20173.
Этот коммит содержится в:
Jeff Squyres 2008-12-31 12:17:08 +00:00
родитель ce313fa391
Коммит 865900dd27
7 изменённых файлов: 225 добавлений и 235 удалений

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

@ -43,7 +43,6 @@
*/ */
BEGIN_C_DECLS BEGIN_C_DECLS
/** /**
* Initialize the coll MCA framework * Initialize the coll MCA framework
* *
@ -160,7 +159,7 @@ int mca_coll_base_comm_unselect(struct ompi_communicator_t *comm);
* *
* It must be the last function invoked on the coll MCA framework. * It must be the last function invoked on the coll MCA framework.
*/ */
OMPI_DECLSPEC int mca_coll_base_close(void); OMPI_DECLSPEC int mca_coll_base_close(void);
/* /*
@ -205,5 +204,4 @@ extern bool mca_coll_base_components_available_valid;
extern opal_list_t mca_coll_base_components_available; extern opal_list_t mca_coll_base_components_available;
END_C_DECLS END_C_DECLS
#endif /* MCA_BASE_COLL_H */ #endif /* MCA_BASE_COLL_H */

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

@ -29,23 +29,24 @@
int mca_coll_base_close(void) int mca_coll_base_close(void)
{ {
/* Close all components that are still open. This may be the opened /* Close all components that are still open. This may be the opened
list (if we're in ompi_info), or it may be the available list (if * list (if we're in ompi_info), or it may be the available list (if
we're anywhere else). */ * we're anywhere else). */
if (mca_coll_base_components_opened_valid) { if (mca_coll_base_components_opened_valid) {
mca_base_components_close(mca_coll_base_output, mca_base_components_close(mca_coll_base_output,
&mca_coll_base_components_opened, NULL); &mca_coll_base_components_opened, NULL);
OBJ_DESTRUCT(&mca_coll_base_components_opened); OBJ_DESTRUCT(&mca_coll_base_components_opened);
mca_coll_base_components_opened_valid = false; mca_coll_base_components_opened_valid = false;
} else if (mca_coll_base_components_available_valid) { } else if (mca_coll_base_components_available_valid) {
mca_base_components_close(mca_coll_base_output, mca_base_components_close(mca_coll_base_output,
&mca_coll_base_components_available, NULL); &mca_coll_base_components_available,
OBJ_DESTRUCT(&mca_coll_base_components_available); NULL);
mca_coll_base_components_available_valid = false; OBJ_DESTRUCT(&mca_coll_base_components_available);
} mca_coll_base_components_available_valid = false;
}
/* All done */ /* All done */
return OMPI_SUCCESS; return OMPI_SUCCESS;
} }

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

@ -38,11 +38,6 @@
#include "ompi/mca/coll/base/base.h" #include "ompi/mca/coll/base/base.h"
/*
* Local variables
*/
/* /*
* Local types * Local types
*/ */
@ -58,20 +53,21 @@ typedef struct avail_coll_t avail_coll_t;
/* /*
* Local functions * Local functions
*/ */
static opal_list_t *check_components(opal_list_t *components, static opal_list_t *check_components(opal_list_t * components,
ompi_communicator_t *comm, ompi_communicator_t * comm,
char **names, int num_names); char **names, int num_names);
static int check_one_component(ompi_communicator_t *comm, static int check_one_component(ompi_communicator_t * comm,
const mca_base_component_t *component, const mca_base_component_t * component,
mca_coll_base_module_2_0_0_t **module); mca_coll_base_module_2_0_0_t ** module);
static int query(const mca_base_component_t *component, static int query(const mca_base_component_t * component,
ompi_communicator_t *comm, int *priority, ompi_communicator_t * comm, int *priority,
mca_coll_base_module_2_0_0_t **module); mca_coll_base_module_2_0_0_t ** module);
static int query_2_0_0(const mca_coll_base_component_2_0_0_t *coll_component, static int query_2_0_0(const mca_coll_base_component_2_0_0_t *
ompi_communicator_t *comm, int *priority, coll_component, ompi_communicator_t * comm,
mca_coll_base_module_2_0_0_t **module); int *priority,
mca_coll_base_module_2_0_0_t ** module);
/* /*
* Stuff for the OBJ interface * Stuff for the OBJ interface
@ -98,7 +94,7 @@ static OBJ_CLASS_INSTANCE(avail_coll_t, opal_list_item_t, NULL, NULL);
* *
* This selection logic is not for the weak. * This selection logic is not for the weak.
*/ */
int mca_coll_base_comm_select(ompi_communicator_t *comm) int mca_coll_base_comm_select(ompi_communicator_t * comm)
{ {
int ret, num_names; int ret, num_names;
char name[MPI_MAX_OBJECT_NAME + 32]; char name[MPI_MAX_OBJECT_NAME + 32];
@ -107,17 +103,17 @@ int mca_coll_base_comm_select(ompi_communicator_t *comm)
opal_list_item_t *item; opal_list_item_t *item;
/* Announce */ /* Announce */
snprintf(name, sizeof(name), "%s (cid %d)", comm->c_name, snprintf(name, sizeof(name), "%s (cid %d)", comm->c_name,
comm->c_contextid); comm->c_contextid);
name[sizeof(name) - 1] = '\0'; name[sizeof(name) - 1] = '\0';
opal_output_verbose(10, mca_coll_base_output, opal_output_verbose(10, mca_coll_base_output,
"coll:base:comm_select: new communicator: %s", "coll:base:comm_select: new communicator: %s",
name); name);
/* Initialize all the relevant pointers, since they're used as /* Initialize all the relevant pointers, since they're used as
sentinel values */ * sentinel values */
memset(&comm->c_coll, 0, sizeof(mca_coll_base_comm_coll_t)); memset(&comm->c_coll, 0, sizeof(mca_coll_base_comm_coll_t));
/* See if a set of component was requested by the MCA parameter. /* See if a set of component was requested by the MCA parameter.
Don't check for error. */ Don't check for error. */
names = NULL; names = NULL;
@ -128,17 +124,17 @@ int mca_coll_base_comm_select(ompi_communicator_t *comm)
name_array = opal_argv_split(names, ','); name_array = opal_argv_split(names, ',');
num_names = opal_argv_count(name_array); num_names = opal_argv_count(name_array);
opal_output_verbose(10, mca_coll_base_output, opal_output_verbose(10, mca_coll_base_output,
"coll:base:comm_select: Checking specific modules: %s", "coll:base:comm_select: Checking specific modules: %s",
names); names);
selectable = check_components(&mca_coll_base_components_available, selectable = check_components(&mca_coll_base_components_available,
comm, name_array, num_names); comm, name_array, num_names);
opal_argv_free(name_array); opal_argv_free(name_array);
} else { } else {
/* no specific components given -- try all */ /* no specific components given -- try all */
opal_output_verbose(10, mca_coll_base_output, opal_output_verbose(10, mca_coll_base_output,
"coll:base:comm_select: Checking all available modules"); "coll:base:comm_select: Checking all available modules");
selectable = check_components(&mca_coll_base_components_available, selectable = check_components(&mca_coll_base_components_available,
comm, NULL, 0); comm, NULL, 0);
} }
@ -157,10 +153,9 @@ int mca_coll_base_comm_select(ompi_communicator_t *comm)
/* do the selection loop */ /* do the selection loop */
for (item = opal_list_remove_first(selectable); for (item = opal_list_remove_first(selectable);
NULL != item; NULL != item; item = opal_list_remove_first(selectable)) {
item = opal_list_remove_first(selectable)) {
avail_coll_t *avail = (avail_coll_t*) item; avail_coll_t *avail = (avail_coll_t *) item;
/* initialize the module */ /* initialize the module */
ret = avail->ac_module->coll_module_enable(avail->ac_module, comm); ret = avail->ac_module->coll_module_enable(avail->ac_module, comm);
@ -170,22 +165,22 @@ int mca_coll_base_comm_select(ompi_communicator_t *comm)
} }
/* copy over any of the pointers */ /* copy over any of the pointers */
COPY(avail->ac_module, comm, allgather); COPY(avail->ac_module, comm, allgather);
COPY(avail->ac_module, comm, allgatherv); COPY(avail->ac_module, comm, allgatherv);
COPY(avail->ac_module, comm, allreduce); COPY(avail->ac_module, comm, allreduce);
COPY(avail->ac_module, comm, alltoall); COPY(avail->ac_module, comm, alltoall);
COPY(avail->ac_module, comm, alltoallv); COPY(avail->ac_module, comm, alltoallv);
COPY(avail->ac_module, comm, alltoallw); COPY(avail->ac_module, comm, alltoallw);
COPY(avail->ac_module, comm, barrier); COPY(avail->ac_module, comm, barrier);
COPY(avail->ac_module, comm, bcast); COPY(avail->ac_module, comm, bcast);
COPY(avail->ac_module, comm, exscan); COPY(avail->ac_module, comm, exscan);
COPY(avail->ac_module, comm, gather); COPY(avail->ac_module, comm, gather);
COPY(avail->ac_module, comm, gatherv); COPY(avail->ac_module, comm, gatherv);
COPY(avail->ac_module, comm, reduce); COPY(avail->ac_module, comm, reduce);
COPY(avail->ac_module, comm, reduce_scatter); COPY(avail->ac_module, comm, reduce_scatter);
COPY(avail->ac_module, comm, scan); COPY(avail->ac_module, comm, scan);
COPY(avail->ac_module, comm, scatter); COPY(avail->ac_module, comm, scatter);
COPY(avail->ac_module, comm, scatterv); COPY(avail->ac_module, comm, scatterv);
/* release the original module reference and the list item */ /* release the original module reference and the list item */
OBJ_RELEASE(avail->ac_module); OBJ_RELEASE(avail->ac_module);
@ -204,14 +199,14 @@ int mca_coll_base_comm_select(ompi_communicator_t *comm)
(NULL == comm->c_coll.coll_alltoallw) || (NULL == comm->c_coll.coll_alltoallw) ||
(NULL == comm->c_coll.coll_barrier) || (NULL == comm->c_coll.coll_barrier) ||
(NULL == comm->c_coll.coll_bcast) || (NULL == comm->c_coll.coll_bcast) ||
((OMPI_COMM_IS_INTRA(comm)) && (NULL == comm->c_coll.coll_exscan)) || ((OMPI_COMM_IS_INTRA(comm)) && (NULL == comm->c_coll.coll_exscan))
(NULL == comm->c_coll.coll_gather) || || (NULL == comm->c_coll.coll_gather)
(NULL == comm->c_coll.coll_gatherv) || || (NULL == comm->c_coll.coll_gatherv)
(NULL == comm->c_coll.coll_reduce) || || (NULL == comm->c_coll.coll_reduce)
(NULL == comm->c_coll.coll_reduce_scatter) || || (NULL == comm->c_coll.coll_reduce_scatter)
((OMPI_COMM_IS_INTRA(comm)) && (NULL == comm->c_coll.coll_scan)) || || ((OMPI_COMM_IS_INTRA(comm)) && (NULL == comm->c_coll.coll_scan))
(NULL == comm->c_coll.coll_scatter) || || (NULL == comm->c_coll.coll_scatter)
(NULL == comm->c_coll.coll_scatterv)) { || (NULL == comm->c_coll.coll_scatterv)) {
mca_coll_base_comm_unselect(comm); mca_coll_base_comm_unselect(comm);
return OMPI_ERR_NOT_FOUND; return OMPI_ERR_NOT_FOUND;
} }
@ -227,8 +222,8 @@ int mca_coll_base_comm_select(ompi_communicator_t *comm)
* only those who returned that they want to run, and put them in * only those who returned that they want to run, and put them in
* priority order. * priority order.
*/ */
static opal_list_t *check_components(opal_list_t *components, static opal_list_t *check_components(opal_list_t * components,
ompi_communicator_t *comm, ompi_communicator_t * comm,
char **names, int num_names) char **names, int num_names)
{ {
int i, priority; int i, priority;
@ -238,18 +233,18 @@ static opal_list_t *check_components(opal_list_t *components,
bool want_to_check; bool want_to_check;
opal_list_t *selectable; opal_list_t *selectable;
avail_coll_t *avail, *avail2; avail_coll_t *avail, *avail2;
/* Make a list of the components that query successfully */ /* Make a list of the components that query successfully */
selectable = OBJ_NEW(opal_list_t); selectable = OBJ_NEW(opal_list_t);
/* Scan through the list of components. This nested loop is O(N^2), /* Scan through the list of components. This nested loop is O(N^2),
but we should never have too many components and/or names, so this but we should never have too many components and/or names, so this
*hopefully* shouldn't matter... */ *hopefully* shouldn't matter... */
for (item = opal_list_get_first(components); for (item = opal_list_get_first(components);
item != opal_list_get_end(components); item != opal_list_get_end(components);
item = opal_list_get_next(item)) { item = opal_list_get_next(item)) {
component = ((mca_base_component_priority_list_item_t *) component = ((mca_base_component_priority_list_item_t *)
item)->super.cli_component; item)->super.cli_component;
/* If we have a list of names, scan through it */ /* If we have a list of names, scan through it */
@ -266,33 +261,35 @@ static opal_list_t *check_components(opal_list_t *components,
} }
/* If we determined that we want to check this component, then do /* If we determined that we want to check this component, then do
so */ * so */
if (want_to_check) { if (want_to_check) {
priority = check_one_component(comm, component, &module); priority = check_one_component(comm, component, &module);
if (priority >= 0) { if (priority >= 0) {
/* We have a component that indicated that it wants to run by /* We have a component that indicated that it wants to run by
giving us a module */ * giving us a module */
avail = OBJ_NEW(avail_coll_t); avail = OBJ_NEW(avail_coll_t);
avail->ac_priority = priority; avail->ac_priority = priority;
avail->ac_module = module; avail->ac_module = module;
/* Put this item on the list in priority order (lowest /* Put this item on the list in priority order (lowest
priority first). Should it go first? */ * priority first). Should it go first? */
for(item2 = opal_list_get_first(selectable); for (item2 = opal_list_get_first(selectable);
item2 != opal_list_get_end(selectable); item2 != opal_list_get_end(selectable);
item2 = opal_list_get_next(item2)) { item2 = opal_list_get_next(item2)) {
avail2 = (avail_coll_t*)item2; avail2 = (avail_coll_t *) item2;
if(avail->ac_priority < avail2->ac_priority) { if (avail->ac_priority < avail2->ac_priority) {
opal_list_insert_pos(selectable, opal_list_insert_pos(selectable,
item2, (opal_list_item_t*)avail); item2,
(opal_list_item_t *) avail);
break; break;
} }
} }
if(opal_list_get_end(selectable) == item2) { if (opal_list_get_end(selectable) == item2) {
opal_list_append(selectable, (opal_list_item_t*)avail); opal_list_append(selectable,
(opal_list_item_t *) avail);
} }
} }
} }
@ -312,9 +309,9 @@ static opal_list_t *check_components(opal_list_t *components,
/* /*
* Check a single component * Check a single component
*/ */
static int check_one_component(ompi_communicator_t *comm, static int check_one_component(ompi_communicator_t * comm,
const mca_base_component_t *component, const mca_base_component_t * component,
mca_coll_base_module_2_0_0_t **module) mca_coll_base_module_2_0_0_t ** module)
{ {
int err; int err;
int priority = -1; int priority = -1;
@ -323,13 +320,13 @@ static int check_one_component(ompi_communicator_t *comm,
if (OMPI_SUCCESS == err) { if (OMPI_SUCCESS == err) {
priority = (priority < 100) ? priority : 100; priority = (priority < 100) ? priority : 100;
opal_output_verbose(10, mca_coll_base_output, opal_output_verbose(10, mca_coll_base_output,
"coll:base:comm_select: component available: %s, priority: %d", "coll:base:comm_select: component available: %s, priority: %d",
component->mca_component_name, priority); component->mca_component_name, priority);
} else { } else {
priority = -1; priority = -1;
opal_output_verbose(10, mca_coll_base_output, opal_output_verbose(10, mca_coll_base_output,
"coll:base:comm_select: component not available: %s", "coll:base:comm_select: component not available: %s",
component->mca_component_name); component->mca_component_name);
} }
@ -346,19 +343,19 @@ static int check_one_component(ompi_communicator_t *comm,
* Take any version of a coll module, query it, and return the right * Take any version of a coll module, query it, and return the right
* module struct * module struct
*/ */
static int query(const mca_base_component_t *component, static int query(const mca_base_component_t * component,
ompi_communicator_t *comm, ompi_communicator_t * comm,
int *priority, mca_coll_base_module_2_0_0_t **module) int *priority, mca_coll_base_module_2_0_0_t ** module)
{ {
*module = NULL; *module = NULL;
if (2 == component->mca_type_major_version && if (2 == component->mca_type_major_version &&
0 == component->mca_type_minor_version && 0 == component->mca_type_minor_version &&
0 == component->mca_type_release_version) { 0 == component->mca_type_release_version) {
const mca_coll_base_component_2_0_0_t *coll100 = const mca_coll_base_component_2_0_0_t *coll100 =
(mca_coll_base_component_2_0_0_t *) component; (mca_coll_base_component_2_0_0_t *) component;
return query_2_0_0(coll100, comm, priority, module); return query_2_0_0(coll100, comm, priority, module);
} }
/* Unknown coll API version -- return error */ /* Unknown coll API version -- return error */
@ -366,9 +363,9 @@ static int query(const mca_base_component_t *component,
} }
static int query_2_0_0(const mca_coll_base_component_2_0_0_t *component, static int query_2_0_0(const mca_coll_base_component_2_0_0_t * component,
ompi_communicator_t *comm, int *priority, ompi_communicator_t * comm, int *priority,
mca_coll_base_module_2_0_0_t **module) mca_coll_base_module_2_0_0_t ** module)
{ {
mca_coll_base_module_2_0_0_t *ret; mca_coll_base_module_2_0_0_t *ret;

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

@ -39,26 +39,25 @@
} \ } \
} while (0) } while (0)
int mca_coll_base_comm_unselect(ompi_communicator_t *comm) int mca_coll_base_comm_unselect(ompi_communicator_t * comm)
{ {
CLOSE(comm, allgather); CLOSE(comm, allgather);
CLOSE(comm, allgatherv); CLOSE(comm, allgatherv);
CLOSE(comm, allreduce); CLOSE(comm, allreduce);
CLOSE(comm, alltoall); CLOSE(comm, alltoall);
CLOSE(comm, alltoallv); CLOSE(comm, alltoallv);
CLOSE(comm, alltoallw); CLOSE(comm, alltoallw);
CLOSE(comm, barrier); CLOSE(comm, barrier);
CLOSE(comm, bcast); CLOSE(comm, bcast);
CLOSE(comm, exscan); CLOSE(comm, exscan);
CLOSE(comm, gather); CLOSE(comm, gather);
CLOSE(comm, gatherv); CLOSE(comm, gatherv);
CLOSE(comm, reduce); CLOSE(comm, reduce);
CLOSE(comm, reduce_scatter); CLOSE(comm, reduce_scatter);
CLOSE(comm, scan); CLOSE(comm, scan);
CLOSE(comm, scatter); CLOSE(comm, scatter);
CLOSE(comm, scatterv); CLOSE(comm, scatterv);
/* All done */ /* All done */
return OMPI_SUCCESS; return OMPI_SUCCESS;
} }

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

@ -44,13 +44,13 @@ opal_list_t mca_coll_base_components_available;
/* /*
* Private functions * Private functions
*/ */
static int init_query(const mca_base_component_t *ls, static int init_query(const mca_base_component_t * ls,
mca_base_component_priority_list_item_t *entry, mca_base_component_priority_list_item_t * entry,
bool enable_progress_threads, bool enable_progress_threads,
bool enable_mpi_threads); bool enable_mpi_threads);
static int init_query_2_0_0(const mca_base_component_t *ls, static int init_query_2_0_0(const mca_base_component_t * ls,
mca_base_component_priority_list_item_t *entry, mca_base_component_priority_list_item_t *
bool enable_progress_threads, entry, bool enable_progress_threads,
bool enable_mpi_threads); bool enable_mpi_threads);
/* /*
@ -69,74 +69,74 @@ static int init_query_2_0_0(const mca_base_component_t *ls,
int mca_coll_base_find_available(bool enable_progress_threads, int mca_coll_base_find_available(bool enable_progress_threads,
bool enable_mpi_threads) bool enable_mpi_threads)
{ {
bool found = false; bool found = false;
mca_base_component_priority_list_item_t *entry; mca_base_component_priority_list_item_t *entry;
opal_list_item_t *p; opal_list_item_t *p;
const mca_base_component_t *component; const mca_base_component_t *component;
/* Initialize the list */ /* Initialize the list */
OBJ_CONSTRUCT(&mca_coll_base_components_available, opal_list_t); OBJ_CONSTRUCT(&mca_coll_base_components_available, opal_list_t);
mca_coll_base_components_available_valid = true; mca_coll_base_components_available_valid = true;
/* The list of components that we should check has already been /* The list of components that we should check has already been
established in mca_coll_base_open. */ established in mca_coll_base_open. */
for (found = false, for (found = false,
p = opal_list_remove_first(&mca_coll_base_components_opened); p = opal_list_remove_first(&mca_coll_base_components_opened);
p != NULL; p != NULL;
p = opal_list_remove_first(&mca_coll_base_components_opened)) { p = opal_list_remove_first(&mca_coll_base_components_opened)) {
component = ((mca_base_component_list_item_t *) p)->cli_component; component = ((mca_base_component_list_item_t *) p)->cli_component;
/* Call a subroutine to do the work, because the component may /* Call a subroutine to do the work, because the component may
represent different versions of the coll MCA. */ represent different versions of the coll MCA. */
entry = OBJ_NEW(mca_base_component_priority_list_item_t); entry = OBJ_NEW(mca_base_component_priority_list_item_t);
entry->super.cli_component = component; entry->super.cli_component = component;
entry->cpli_priority = 0; entry->cpli_priority = 0;
if (OMPI_SUCCESS == init_query(component, entry, if (OMPI_SUCCESS == init_query(component, entry,
enable_progress_threads, enable_progress_threads,
enable_mpi_threads)) { enable_mpi_threads)) {
opal_list_append(&mca_coll_base_components_available, opal_list_append(&mca_coll_base_components_available,
(opal_list_item_t *) entry); (opal_list_item_t *) entry);
found = true; found = true;
} else { } else {
/* If the component doesn't want to run, then close it. It's /* If the component doesn't want to run, then close it.
already had its close() method invoked; now close it out of It's already had its close() method invoked; now close
the DSO repository (if it's there). */ it out of the DSO repository (if it's there). */
mca_base_component_repository_release(component); mca_base_component_repository_release(component);
OBJ_RELEASE(entry); OBJ_RELEASE(entry);
}
/* Free the entry from the "opened" list */
OBJ_RELEASE(p);
} }
/* Free the entry from the "opened" list */ /* The opened list is now no longer useful and we can free it */
OBJ_RELEASE(p); OBJ_DESTRUCT(&mca_coll_base_components_opened);
} mca_coll_base_components_opened_valid = false;
/* The opened list is now no longer useful and we can free it */ /* If we have no collective components available, it's an error.
Thanks for playing! */
OBJ_DESTRUCT(&mca_coll_base_components_opened);
mca_coll_base_components_opened_valid = false;
/* If we have no collective components available, it's an error. if (!found) {
Thanks for playing! */ /* Need to free all items in the list */
OBJ_DESTRUCT(&mca_coll_base_components_available);
if (!found) { mca_coll_base_components_available_valid = false;
/* Need to free all items in the list */ opal_output_verbose(10, mca_coll_base_output,
OBJ_DESTRUCT(&mca_coll_base_components_available); "coll:find_available: no coll components available!");
mca_coll_base_components_available_valid = false; orte_show_help("help-mca-base", "find-available:none-found", true,
opal_output_verbose(10, mca_coll_base_output, "coll");
"coll:find_available: no coll components available!"); return OMPI_ERROR;
orte_show_help("help-mca-base", "find-available:none-found", true, }
"coll");
return OMPI_ERROR;
}
/* All done */ /* All done */
return OMPI_SUCCESS; return OMPI_SUCCESS;
} }
@ -144,67 +144,66 @@ int mca_coll_base_find_available(bool enable_progress_threads,
* Query a component, see if it wants to run at all. If it does, save * Query a component, see if it wants to run at all. If it does, save
* some information. If it doesn't, close it. * some information. If it doesn't, close it.
*/ */
static int init_query(const mca_base_component_t *m, static int init_query(const mca_base_component_t * m,
mca_base_component_priority_list_item_t *entry, mca_base_component_priority_list_item_t * entry,
bool enable_progress_threads, bool enable_progress_threads, bool enable_mpi_threads)
bool enable_mpi_threads)
{ {
int ret; int ret;
opal_output_verbose(10, mca_coll_base_output,
"coll:find_available: querying coll component %s",
m->mca_component_name);
/* This component has already been successfully opened. So now query
it. */
if (2 == m->mca_type_major_version &&
0 == m->mca_type_minor_version &&
0 == m->mca_type_release_version) {
ret = init_query_2_0_0(m, entry, enable_progress_threads,
enable_mpi_threads);
} else {
/* Unrecognized coll API version */
opal_output_verbose(10, mca_coll_base_output, opal_output_verbose(10, mca_coll_base_output,
"coll:find_available: unrecognized coll API version (%d.%d.%d, ignored)", "coll:find_available: querying coll component %s",
m->mca_type_major_version,
m->mca_type_minor_version,
m->mca_type_release_version);
return OMPI_ERROR;
}
/* Query done -- look at the return value to see what happened */
if (OMPI_SUCCESS != ret) {
opal_output_verbose(10, mca_coll_base_output,
"coll:find_available: coll component %s is not available",
m->mca_component_name); m->mca_component_name);
if (NULL != m->mca_close_component) {
m->mca_close_component(); /* This component has already been successfully opened. So now
query it. */
if (2 == m->mca_type_major_version &&
0 == m->mca_type_minor_version &&
0 == m->mca_type_release_version) {
ret = init_query_2_0_0(m, entry, enable_progress_threads,
enable_mpi_threads);
} else {
/* Unrecognized coll API version */
opal_output_verbose(10, mca_coll_base_output,
"coll:find_available: unrecognized coll API version (%d.%d.%d, ignored)",
m->mca_type_major_version,
m->mca_type_minor_version,
m->mca_type_release_version);
return OMPI_ERROR;
} }
} else {
opal_output_verbose(10, mca_coll_base_output,
"coll:find_available: coll component %s is available",
m->mca_component_name);
}
/* All done */ /* Query done -- look at the return value to see what happened */
return ret; if (OMPI_SUCCESS != ret) {
opal_output_verbose(10, mca_coll_base_output,
"coll:find_available: coll component %s is not available",
m->mca_component_name);
if (NULL != m->mca_close_component) {
m->mca_close_component();
}
} else {
opal_output_verbose(10, mca_coll_base_output,
"coll:find_available: coll component %s is available",
m->mca_component_name);
}
/* All done */
return ret;
} }
/* /*
* Query a specific component, coll v2.0.0 * Query a specific component, coll v2.0.0
*/ */
static int init_query_2_0_0(const mca_base_component_t *component, static int init_query_2_0_0(const mca_base_component_t * component,
mca_base_component_priority_list_item_t *entry, mca_base_component_priority_list_item_t * entry,
bool enable_progress_threads, bool enable_progress_threads,
bool enable_mpi_threads) bool enable_mpi_threads)
{ {
mca_coll_base_component_2_0_0_t *coll = mca_coll_base_component_2_0_0_t *coll =
(mca_coll_base_component_2_0_0_t *) component; (mca_coll_base_component_2_0_0_t *) component;
return coll->collm_init_query(enable_progress_threads, return coll->collm_init_query(enable_progress_threads,
enable_mpi_threads); enable_mpi_threads);

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

@ -31,7 +31,6 @@
#include "ompi/mca/coll/coll.h" #include "ompi/mca/coll/coll.h"
#include "ompi/mca/coll/base/base.h" #include "ompi/mca/coll/base/base.h"
/* /*
* The following file was created by configure. It contains extern * The following file was created by configure. It contains extern
* statements and the definition of an array of pointers to each * statements and the definition of an array of pointers to each
@ -40,7 +39,6 @@
#include "ompi/mca/coll/base/static-components.h" #include "ompi/mca/coll/base/static-components.h"
/* /*
* Global variables; most of which are loaded by back-ends of MCA * Global variables; most of which are loaded by back-ends of MCA
* variables * variables
@ -68,9 +66,9 @@ int mca_coll_base_open(void)
/* Open up all available components */ /* Open up all available components */
if (OMPI_SUCCESS != if (OMPI_SUCCESS !=
mca_base_components_open("coll", mca_coll_base_output, mca_base_components_open("coll", mca_coll_base_output,
mca_coll_base_static_components, mca_coll_base_static_components,
&mca_coll_base_components_opened, true)) { &mca_coll_base_components_opened, true)) {
return OMPI_ERROR; return OMPI_ERROR;
} }

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

@ -40,6 +40,4 @@
#define MCA_COLL_BASE_TAG_SCAN -23 #define MCA_COLL_BASE_TAG_SCAN -23
#define MCA_COLL_BASE_TAG_SCATTER -24 #define MCA_COLL_BASE_TAG_SCATTER -24
#define MCA_COLL_BASE_TAG_SCATTERV -25 #define MCA_COLL_BASE_TAG_SCATTERV -25
#endif /* MCA_COLL_BASE_TAGS_H */ #endif /* MCA_COLL_BASE_TAGS_H */