diff --git a/src/mca/coll/basic/coll_basic.c b/src/mca/coll/basic/coll_basic.c index 14f2c23312..c00bf0eade 100644 --- a/src/mca/coll/basic/coll_basic.c +++ b/src/mca/coll/basic/coll_basic.c @@ -134,12 +134,8 @@ int mca_coll_basic_init_query(bool *allow_multi_user_threads, const mca_coll_base_module_1_0_0_t * mca_coll_basic_comm_query(struct ompi_communicator_t *comm, int *priority) { - int param; - - /* Use a low priority, but allow other components to be lower */ - - param = mca_base_param_register_int("coll", "basic", "priority", NULL, 10); - if (OMPI_SUCCESS != mca_base_param_lookup_int(param, priority)) { + if (OMPI_SUCCESS != mca_base_param_lookup_int(mca_coll_basic_priority_param, + priority)) { return NULL; } diff --git a/src/mca/coll/basic/coll_basic.h b/src/mca/coll/basic/coll_basic.h index aea35c5324..52b6c59c4c 100644 --- a/src/mca/coll/basic/coll_basic.h +++ b/src/mca/coll/basic/coll_basic.h @@ -19,6 +19,7 @@ */ extern const mca_coll_base_component_1_0_0_t mca_coll_basic_component; +extern int mca_coll_basic_priority_param; /* diff --git a/src/mca/coll/basic/coll_basic_component.c b/src/mca/coll/basic/coll_basic_component.c index 62cffc10d7..cefaf01d2a 100644 --- a/src/mca/coll/basic/coll_basic_component.c +++ b/src/mca/coll/basic/coll_basic_component.c @@ -22,6 +22,16 @@ const char *mca_coll_basic_component_version_string = "Open MPI basic collective MCA component version " MCA_coll_basic_FULL_VERSION; +/* + * Global variable + */ +int mca_coll_basic_priority_param = -1; + +/* + * Local function + */ +static int basic_open(void); + /* * Instantiate the public struct with all of our public information * and pointers to our public functions in it @@ -47,7 +57,7 @@ const mca_coll_base_component_1_0_0_t mca_coll_basic_component = { /* Component open and close functions */ - NULL, + basic_open, NULL }, @@ -65,3 +75,14 @@ const mca_coll_base_component_1_0_0_t mca_coll_basic_component = { mca_coll_basic_comm_query, NULL }; + + +static int basic_open(void) +{ + /* Use a low priority, but allow other components to be lower */ + + mca_coll_basic_priority_param = + mca_base_param_register_int("coll", "basic", "priority", NULL, 10); + + return OMPI_SUCCESS; +}