diff --git a/src/mca/base/base.h b/src/mca/base/base.h index 4608c94ef2..f3489ea03d 100644 --- a/src/mca/base/base.h +++ b/src/mca/base/base.h @@ -127,6 +127,8 @@ OMPI_DECLSPEC int mca_base_component_repository_initialize(void); OMPI_DECLSPEC int mca_base_component_repository_retain(char *type, lt_dlhandle component_handle, const mca_base_component_t *component_struct); +OMPI_DECLSPEC int mca_base_component_repository_retain_component(const char *type, + const char *name); OMPI_DECLSPEC int mca_base_component_repository_link(const char *src_type, const char *src_name, const char *depend_type, diff --git a/src/mca/base/mca_base_component_repository.c b/src/mca/base/mca_base_component_repository.c index ddf564643e..8a40745359 100644 --- a/src/mca/base/mca_base_component_repository.c +++ b/src/mca/base/mca_base_component_repository.c @@ -134,6 +134,21 @@ int mca_base_component_repository_retain(char *type, } +/* + * Bump up the refcount on a component + */ +int mca_base_component_repository_retain_component(const char *type, + const char *name) +{ + repository_item_t *ri = find_component(type, name); + if (NULL != ri) { + OBJ_RETAIN(ri); + return OMPI_SUCCESS; + } + return OMPI_ERR_NOT_FOUND; +} + + /* * Create a dependency from one component entry to another */