1
1

Fix some minor buglets that were missed in the initial code review.

This commit was SVN r1853.
Этот коммит содержится в:
Jeff Squyres 2004-08-03 21:29:23 +00:00
родитель 1b319f091e
Коммит d649161279
2 изменённых файлов: 10 добавлений и 9 удалений

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

@ -295,8 +295,8 @@ static ompi_list_t *check_components(ompi_list_t *components,
{ {
int i, priority; int i, priority;
const mca_base_component_t *component; const mca_base_component_t *component;
ompi_list_item_t *item, *next, *item2; ompi_list_item_t *item, *item2;
const mca_coll_base_module_1_0_0_t *actions; const mca_coll_base_module_1_0_0_t *module;
bool want_to_check; bool want_to_check;
ompi_list_t *selectable; ompi_list_t *selectable;
avail_coll_t *avail, *avail2; avail_coll_t *avail, *avail2;
@ -311,10 +311,9 @@ static ompi_list_t *check_components(ompi_list_t *components,
for (item = ompi_list_get_first(components); for (item = ompi_list_get_first(components);
item != ompi_list_get_end(components); item != ompi_list_get_end(components);
item = next) { item = ompi_list_get_next(item)) {
component = ((mca_base_component_priority_list_item_t *) component = ((mca_base_component_priority_list_item_t *)
item)->cpli_component; item)->cpli_component;
next = ompi_list_get_next(component);
/* If we have a list of names, scan through it */ /* If we have a list of names, scan through it */
@ -333,7 +332,7 @@ static ompi_list_t *check_components(ompi_list_t *components,
so */ so */
if (want_to_check) { if (want_to_check) {
priority = check_one_component(comm, component, &actions); 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
@ -342,6 +341,7 @@ static ompi_list_t *check_components(ompi_list_t *components,
avail = OBJ_NEW(avail_coll_t); avail = OBJ_NEW(avail_coll_t);
avail->ac_priority = 0; avail->ac_priority = 0;
avail->ac_component = (mca_coll_base_component_1_0_0_t *) component; avail->ac_component = (mca_coll_base_component_1_0_0_t *) component;
avail->ac_module = module;
/* Put this item on the list in priority order (highest /* Put this item on the list in priority order (highest
priority first). Should it go first? */ priority first). Should it go first? */
@ -349,13 +349,13 @@ static ompi_list_t *check_components(ompi_list_t *components,
item2 = ompi_list_get_first(selectable); item2 = ompi_list_get_first(selectable);
avail2 = (avail_coll_t *) item2; avail2 = (avail_coll_t *) item2;
if (avail->ac_priority > avail2->ac_priority) { if (avail->ac_priority > avail2->ac_priority) {
ompi_list_prepend(selectable, item); ompi_list_prepend(selectable, avail);
} else { } else {
for (i = 1; item2 != ompi_list_get_end(selectable); for (i = 1; item2 != ompi_list_get_end(selectable);
item2 = ompi_list_get_next(selectable), ++i) { item2 = ompi_list_get_next(selectable), ++i) {
avail2 = (avail_coll_t *) item2; avail2 = (avail_coll_t *) item2;
if (avail->ac_priority > avail2->ac_priority) { if (avail->ac_priority > avail2->ac_priority) {
ompi_list_insert(selectable, item, i); ompi_list_insert(selectable, avail, i);
break; break;
} }
} }
@ -364,7 +364,7 @@ static ompi_list_t *check_components(ompi_list_t *components,
append it (because it has the lowest priority found so append it (because it has the lowest priority found so
far) */ far) */
if (ompi_list_get_end(selectable) == item2) { if (ompi_list_get_end(selectable) == item2) {
ompi_list_append(selectable, item); ompi_list_append(selectable, avail);
} }
} }
} }
@ -419,7 +419,7 @@ 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
* actions 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,

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

@ -83,6 +83,7 @@ int mca_coll_base_find_available(bool *allow_multi_user_threads,
if (0 == strcmp(component->mca_component_name, "basic")) { if (0 == strcmp(component->mca_component_name, "basic")) {
mca_coll_base_basic_component = mca_coll_base_basic_component =
(mca_coll_base_component_1_0_0_t *) component; (mca_coll_base_component_1_0_0_t *) component;
OBJ_RELEASE(entry);
} }
/* Otherwise, save the results in the list. The priority isn't /* Otherwise, save the results in the list. The priority isn't