1
1
openmpi/opal/mca/base/mca_base_components_close.c
Jeff Squyres 3962c53e2e - Add to AM_CPPFLAGS $(OPAL_LTDL_CPPFLAGS) where necessary in order to
add a -I to find the included ltdl.h (vs. a system-installed ltdl.h)
- Clean up kruft in a bunch of Makefile.am's to remove now-unnecessary
  AM_CPPFLAGS settings to get static-components.h for each framework
- Move the component_repository API functions out of opal/mca/base/base.h
  and into opal/mca/base/mca_base_component_repository.h in order to
  decrease unnecessary dependencies (e.g., before this, almost
  everything in the tree depended on ltdl.h, which is unnecessary --
  only a small number of files really need ltdl.h)

This commit was SVN r7127.
2005-09-01 12:16:36 +00:00

80 строки
2.5 KiB
C

/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include "opal/class/opal_list.h"
#include "opal/util/output.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
#include "opal/mca/base/mca_base_component_repository.h"
#include "ompi/include/constants.h"
int mca_base_components_close(int output_id,
opal_list_t *components_available,
const mca_base_component_t *skip)
{
opal_list_item_t *item;
mca_base_component_priority_list_item_t *pcli, *skipped_pcli = NULL;
const mca_base_component_t *component;
/* 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. */
for (item = opal_list_remove_first(components_available);
NULL != item;
item = opal_list_remove_first(components_available)) {
pcli = (mca_base_component_priority_list_item_t *) item;
component = pcli->super.cli_component;
if (component != skip) {
/* 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);
}
/* Unload */
opal_output_verbose(10, output_id,
"mca: base: close: unloading component %s",
component->mca_component_name);
mca_base_component_repository_release((mca_base_component_t *) component);
free(pcli);
} else {
skipped_pcli = pcli;
}
}
/* If we found it, re-add the skipped component to the available
list (see above comment) */
if (NULL != skipped_pcli) {
opal_list_append(components_available, (opal_list_item_t *) skipped_pcli);
}
/* All done */
return OMPI_SUCCESS;
}