Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions ompi/mca/topo/base/topo_base_lazy_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ int mca_topo_base_lazy_init(void)
{
int err;

if (0 == opal_list_get_size(&ompi_topo_base_framework.framework_components)) {
ompi_topo_base_framework.framework_open(MCA_BASE_OPEN_FIND_COMPONENTS);
if (!mca_base_framework_is_open (&ompi_topo_base_framework)) {
/**
* Register all available components, giving them a chance to access the MCA parameters.
* Register and open all available components, giving them a chance to access the MCA parameters.
*/
mca_base_framework_register(&ompi_topo_base_framework, MCA_BASE_REGISTER_DEFAULT);
mca_base_framework_open (&ompi_topo_base_framework, MCA_BASE_REGISTER_DEFAULT);
if (OMPI_SUCCESS !=
(err = mca_topo_base_find_available(OPAL_ENABLE_PROGRESS_THREADS,
OMPI_ENABLE_THREAD_MULTIPLE))) {
Expand Down
12 changes: 6 additions & 6 deletions opal/mca/base/mca_base_framework.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
#include "mca_base_var.h"
#include "opal/mca/base/base.h"

static bool framework_is_registered (struct mca_base_framework_t *framework)
bool mca_base_framework_is_registered (struct mca_base_framework_t *framework)
{
return !!(framework->framework_flags & MCA_BASE_FRAMEWORK_FLAG_REGISTERED);
}

static bool framework_is_open (struct mca_base_framework_t *framework)
bool mca_base_framework_is_open (struct mca_base_framework_t *framework)
{
return !!(framework->framework_flags & MCA_BASE_FRAMEWORK_FLAG_OPEN);
}
Expand Down Expand Up @@ -61,7 +61,7 @@ int mca_base_framework_register (struct mca_base_framework_t *framework,

framework->framework_refcnt++;

if (framework_is_registered (framework)) {
if (mca_base_framework_is_registered (framework)) {
return OPAL_SUCCESS;
}

Expand Down Expand Up @@ -143,7 +143,7 @@ int mca_base_framework_open (struct mca_base_framework_t *framework,
}

/* check if this framework is already open */
if (framework_is_open (framework)) {
if (mca_base_framework_is_open (framework)) {
return OPAL_SUCCESS;
}

Expand Down Expand Up @@ -180,8 +180,8 @@ int mca_base_framework_open (struct mca_base_framework_t *framework,
}

int mca_base_framework_close (struct mca_base_framework_t *framework) {
bool is_open = framework_is_open (framework);
bool is_registered = framework_is_registered (framework);
bool is_open = mca_base_framework_is_open (framework);
bool is_registered = mca_base_framework_is_registered (framework);
int ret, group_id;

assert (NULL != framework);
Expand Down
23 changes: 23 additions & 0 deletions opal/mca/base/mca_base_framework.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,29 @@ OPAL_DECLSPEC int mca_base_framework_open (mca_base_framework_t *framework,
*/
OPAL_DECLSPEC int mca_base_framework_close (mca_base_framework_t *framework);


/**
* Check if a framework is already registered
*
* @param[in] framework framework to query
*
* @retval true if the framework's mca variables are registered
* @retval false if not
*/
OPAL_DECLSPEC bool mca_base_framework_is_registered (struct mca_base_framework_t *framework);


/**
* Check if a framework is already open
*
* @param[in] framework framework to query
*
* @retval true if the framework is open
* @retval false if not
*/
OPAL_DECLSPEC bool mca_base_framework_is_open (struct mca_base_framework_t *framework);


/**
* Macro to declare an MCA framework
*
Expand Down