2013-03-28 01:10:18 +04:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
2004-08-02 04:24:22 +04:00
|
|
|
/*
|
2006-02-28 15:33:42 +03:00
|
|
|
* Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
2005-11-05 22:57:48 +03:00
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2006-02-28 15:33:42 +03:00
|
|
|
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
2005-11-05 22:57:48 +03:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2006-02-28 15:33:42 +03:00
|
|
|
* Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
|
2004-11-28 23:09:25 +03:00
|
|
|
* University of Stuttgart. All rights reserved.
|
2006-02-28 15:33:42 +03:00
|
|
|
* Copyright (c) 2004-2006 The Regents of the University of California.
|
2005-03-24 15:43:37 +03:00
|
|
|
* All rights reserved.
|
2013-03-28 01:10:18 +04:00
|
|
|
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
|
|
|
|
* reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-08-02 04:24:22 +04:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "opal_config.h"
|
2004-08-02 04:24:22 +04:00
|
|
|
|
2005-07-03 20:22:16 +04:00
|
|
|
#include "opal/class/opal_list.h"
|
2005-07-04 03:31:27 +04:00
|
|
|
#include "opal/util/output.h"
|
2005-08-13 00:46:25 +04:00
|
|
|
#include "opal/mca/mca.h"
|
|
|
|
#include "opal/mca/base/base.h"
|
2005-09-01 16:16:36 +04:00
|
|
|
#include "opal/mca/base/mca_base_component_repository.h"
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "opal/constants.h"
|
2004-08-02 04:24:22 +04:00
|
|
|
|
2013-08-10 00:16:08 +04:00
|
|
|
void mca_base_component_unload (const mca_base_component_t *component, int output_id)
|
2013-03-28 01:09:41 +04:00
|
|
|
{
|
2013-03-28 01:10:18 +04:00
|
|
|
int ret;
|
2013-03-28 01:09:41 +04:00
|
|
|
|
|
|
|
/* Unload */
|
|
|
|
opal_output_verbose(10, output_id,
|
|
|
|
"mca: base: close: unloading component %s",
|
|
|
|
component->mca_component_name);
|
2013-03-28 01:10:18 +04:00
|
|
|
|
|
|
|
/* XXX -- TODO -- Replace reserved by mca_project_name for 1.9 */
|
|
|
|
ret = mca_base_var_group_find (component->reserved, component->mca_type_name,
|
|
|
|
component->mca_component_name);
|
|
|
|
if (0 <= ret) {
|
|
|
|
mca_base_var_group_deregister (ret);
|
|
|
|
}
|
|
|
|
|
2013-08-10 00:16:08 +04:00
|
|
|
mca_base_component_repository_release((mca_base_component_t *) component);
|
|
|
|
}
|
|
|
|
|
|
|
|
void mca_base_component_close (const mca_base_component_t *component, int output_id)
|
|
|
|
{
|
|
|
|
/* Close */
|
|
|
|
if (NULL != component->mca_close_component) {
|
|
|
|
component->mca_close_component();
|
|
|
|
opal_output_verbose(10, output_id,
|
|
|
|
"mca: base: close: component %s closed",
|
|
|
|
component->mca_component_name);
|
|
|
|
}
|
|
|
|
|
|
|
|
mca_base_component_unload (component, output_id);
|
2013-03-28 01:10:18 +04:00
|
|
|
}
|
2013-03-28 01:09:41 +04:00
|
|
|
|
2013-03-28 01:10:18 +04:00
|
|
|
int mca_base_framework_components_close (mca_base_framework_t *framework,
|
|
|
|
const mca_base_component_t *skip)
|
|
|
|
{
|
|
|
|
return mca_base_components_close (framework->framework_output,
|
|
|
|
&framework->framework_components,
|
|
|
|
skip);
|
2013-03-28 01:09:41 +04:00
|
|
|
}
|
|
|
|
|
2013-03-28 01:10:18 +04:00
|
|
|
int mca_base_components_close(int output_id, opal_list_t *components,
|
2004-08-02 04:24:22 +04:00
|
|
|
const mca_base_component_t *skip)
|
|
|
|
{
|
2013-03-28 01:10:18 +04:00
|
|
|
mca_base_component_list_item_t *cli, *next;
|
2004-08-02 04:24:22 +04:00
|
|
|
|
2013-03-28 01:10:18 +04:00
|
|
|
/* Close and unload all components in the available list, except the
|
|
|
|
"skip" item. This is handy to close out all non-selected
|
|
|
|
components. It's easier to simply remove the entire list and
|
|
|
|
then simply re-add the skip entry when done. */
|
2004-08-02 04:24:22 +04:00
|
|
|
|
2013-03-28 01:10:18 +04:00
|
|
|
OPAL_LIST_FOREACH_SAFE(cli, next, components, mca_base_component_list_item_t) {
|
|
|
|
if (skip == cli->cli_component) {
|
|
|
|
continue;
|
|
|
|
}
|
2004-08-02 04:24:22 +04:00
|
|
|
|
2013-03-28 01:10:18 +04:00
|
|
|
mca_base_component_close (cli->cli_component, output_id);
|
|
|
|
opal_list_remove_item (components, &cli->super);
|
2004-08-02 04:24:22 +04:00
|
|
|
|
2013-03-28 01:10:18 +04:00
|
|
|
OBJ_RELEASE(cli);
|
|
|
|
}
|
2004-08-02 04:24:22 +04:00
|
|
|
|
2013-03-28 01:10:18 +04:00
|
|
|
/* All done */
|
|
|
|
return OPAL_SUCCESS;
|
2004-08-02 04:24:22 +04:00
|
|
|
}
|