bdedd8b0d3
Reasoning: The old behavior was a little confusing. mca_base_components_open does not open an output stream so it is a little unexpected that mca_base_components_close does. To add to this several frameworks (that don't use mca_base_components_close) failed to close their output in the framework close function and others closed their output a second time. This change is an improvement to the symantics of mca_base_components_open/close as they are now symetric in their functionality. This commit was SVN r27570.
49 строки
1.1 KiB
C
49 строки
1.1 KiB
C
/*
|
|
* Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
|
|
* $COPYRIGHT$
|
|
*
|
|
* Additional copyrights may follow
|
|
*
|
|
* $HEADER$
|
|
*/
|
|
|
|
#include "orte_config.h"
|
|
#include "orte/constants.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
#include "opal/mca/mca.h"
|
|
#include "opal/mca/base/base.h"
|
|
|
|
#include "orte/mca/dfs/dfs.h"
|
|
#include "orte/mca/dfs/base/base.h"
|
|
|
|
|
|
int orte_dfs_base_close(void)
|
|
{
|
|
/* if not initialized, then skip this action. */
|
|
if (!orte_dfs_base.initialized) {
|
|
return ORTE_SUCCESS;
|
|
}
|
|
|
|
/* Close selected component */
|
|
if (NULL != orte_dfs.finalize) {
|
|
orte_dfs.finalize();
|
|
}
|
|
|
|
/* Close all remaining available components (may be one if this is a
|
|
* OMPI RTE program, or [possibly] multiple if this is ompi_info)
|
|
*/
|
|
mca_base_components_close(orte_dfs_base.output,
|
|
&orte_dfs_base.components_available,
|
|
NULL);
|
|
|
|
/* Close the framework output */
|
|
opal_output_close (orte_dfs_base.output);
|
|
orte_dfs_base.output = -1;
|
|
|
|
orte_dfs_base.initialized = false;
|
|
|
|
return ORTE_SUCCESS;
|
|
}
|