Fix some stylistic problems and code errors, found during code review
with Anju This commit was SVN r1656.
Этот коммит содержится в:
родитель
ebcbd1ca14
Коммит
caaa2039d5
@ -171,7 +171,7 @@ int mca_coll_base_comm_select(ompi_communicator_t *comm,
|
|||||||
in the MCA parameter; parse them and check them all */
|
in the MCA parameter; parse them and check them all */
|
||||||
|
|
||||||
else if (NULL != names && 0 < strlen(names)) {
|
else if (NULL != names && 0 < strlen(names)) {
|
||||||
name_array = ompi_argv_split("names", ',');
|
name_array = ompi_argv_split(names, ',');
|
||||||
num_names = ompi_argv_count(name_array);
|
num_names = ompi_argv_count(name_array);
|
||||||
|
|
||||||
ompi_output_verbose(10, mca_coll_base_output,
|
ompi_output_verbose(10, mca_coll_base_output,
|
||||||
|
@ -52,6 +52,7 @@ int mca_coll_base_find_available(bool *allow_multi_user_threads,
|
|||||||
bool found = false;
|
bool found = false;
|
||||||
mca_base_component_priority_list_item_t *entry;
|
mca_base_component_priority_list_item_t *entry;
|
||||||
ompi_list_item_t *p;
|
ompi_list_item_t *p;
|
||||||
|
const mca_base_module_t *component;
|
||||||
|
|
||||||
/* Initialize the list */
|
/* Initialize the list */
|
||||||
|
|
||||||
@ -65,22 +66,20 @@ int mca_coll_base_find_available(bool *allow_multi_user_threads,
|
|||||||
p = ompi_list_remove_first(&mca_coll_base_components_opened);
|
p = ompi_list_remove_first(&mca_coll_base_components_opened);
|
||||||
p != NULL;
|
p != NULL;
|
||||||
p = ompi_list_remove_first(&mca_coll_base_components_opened)) {
|
p = ompi_list_remove_first(&mca_coll_base_components_opened)) {
|
||||||
|
component = ((mca_base_module_list_item_t *) p)->mli_module;
|
||||||
entry = OBJ_NEW(mca_base_component_priority_list_item_t);
|
|
||||||
entry->cpli_component = ((mca_base_module_list_item_t *) p)->mli_module;
|
|
||||||
|
|
||||||
/* 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. */
|
||||||
|
|
||||||
if (init_query(entry->cpli_component, entry) == 0) {
|
if (OMPI_SUCCESS == init_query(component, entry)) {
|
||||||
|
|
||||||
/* Is this the basic component? If so, save it, because it's
|
/* Is this the basic component? If so, save it, because it's
|
||||||
special. Keep it off the available list -- we'll use it
|
special. Keep it off the available list -- we'll use it
|
||||||
specially in the selection process. */
|
specially in the selection process. */
|
||||||
|
|
||||||
if (0 == strcmp(entry->cpli_component->mca_module_name, "basic")) {
|
if (0 == strcmp(component->mca_module_name, "basic")) {
|
||||||
mca_coll_base_basic_component =
|
mca_coll_base_basic_component =
|
||||||
(mca_coll_base_module_1_0_0_t *) entry->cpli_component;
|
(mca_coll_base_module_1_0_0_t *) component;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Otherwise, save the results in the list. The priority isn't
|
/* Otherwise, save the results in the list. The priority isn't
|
||||||
@ -91,6 +90,8 @@ int mca_coll_base_find_available(bool *allow_multi_user_threads,
|
|||||||
level for this process. */
|
level for this process. */
|
||||||
|
|
||||||
else {
|
else {
|
||||||
|
entry = OBJ_NEW(mca_base_component_priority_list_item_t);
|
||||||
|
entry->cpli_component = component;
|
||||||
entry->cpli_priority = 0;
|
entry->cpli_priority = 0;
|
||||||
ompi_list_append(&mca_coll_base_components_available,
|
ompi_list_append(&mca_coll_base_components_available,
|
||||||
(ompi_list_item_t *) entry);
|
(ompi_list_item_t *) entry);
|
||||||
@ -105,13 +106,12 @@ int mca_coll_base_find_available(bool *allow_multi_user_threads,
|
|||||||
already had its close() method invoked; now close it out of
|
already had its close() method invoked; now close it out of
|
||||||
the DSO repository (if it's there). */
|
the DSO repository (if it's there). */
|
||||||
|
|
||||||
mca_base_module_repository_release(entry->cpli_component);
|
mca_base_module_repository_release(component);
|
||||||
OBJ_RELEASE(entry);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free the entry from the "opened" list */
|
/* Free the entry from the "opened" list */
|
||||||
|
|
||||||
free(p);
|
OBJ_RELEASE(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The opened list is now no longer useful and we can free it */
|
/* The opened list is now no longer useful and we can free it */
|
||||||
@ -154,9 +154,9 @@ static int init_query(const mca_base_module_t *m,
|
|||||||
/* This component has already been successfully opened. So now query
|
/* This component has already been successfully opened. So now query
|
||||||
it. */
|
it. */
|
||||||
|
|
||||||
if (m->mca_type_major_version == 1 &&
|
if (1 == m->mca_type_major_version &&
|
||||||
m->mca_type_minor_version == 0 &&
|
0 == m->mca_type_minor_version &&
|
||||||
m->mca_type_release_version == 0) {
|
0 == m->mca_type_release_version) {
|
||||||
ret = init_query_1_0_0(m, entry);
|
ret = init_query_1_0_0(m, entry);
|
||||||
} else {
|
} else {
|
||||||
/* Unrecognized coll API version */
|
/* Unrecognized coll API version */
|
||||||
@ -172,7 +172,7 @@ static int init_query(const mca_base_module_t *m,
|
|||||||
|
|
||||||
/* Query done -- look at the return value to see what happened */
|
/* Query done -- look at the return value to see what happened */
|
||||||
|
|
||||||
if (ret != 0) {
|
if (OMPI_SUCCESS != ret) {
|
||||||
ompi_output_verbose(10, mca_coll_base_output,
|
ompi_output_verbose(10, mca_coll_base_output,
|
||||||
"coll:find_available: coll component %s is not available",
|
"coll:find_available: coll component %s is not available",
|
||||||
m->mca_module_name);
|
m->mca_module_name);
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user