9613b3176c
After much work by Jeff and myself, and quite a lot of discussion, it has become clear that we simply cannot resolve the infinite loops caused by RML-involved subsystems calling orte_output. The original rationale for the change to orte_output has also been reduced by shifting the output of XML-formatted vs human readable messages to an alternative approach. I have globally replaced the orte_output/ORTE_OUTPUT calls in the code base, as well as the corresponding .h file name. I have test compiled and run this on the various environments within my reach, so hopefully this will prove minimally disruptive. This commit was SVN r18619.
118 строки
3.3 KiB
C
118 строки
3.3 KiB
C
/*
|
|
* Copyright (c) 2007 Los Alamos National Security, LLC.
|
|
* All rights reserved.
|
|
* Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
|
|
* Copyright (c) 2004-2008 The Trustees of Indiana University.
|
|
* All rights reserved.
|
|
* $COPYRIGHT$
|
|
*
|
|
* Additional copyrights may follow
|
|
*
|
|
* $HEADER$
|
|
*/
|
|
|
|
#include "orte_config.h"
|
|
|
|
#include "orte/util/show_help.h"
|
|
#include "opal/mca/mca.h"
|
|
#include "opal/mca/base/mca_base_component_repository.h"
|
|
|
|
#include "orte/util/show_help.h"
|
|
#include "orte/mca/errmgr/errmgr.h"
|
|
|
|
#include "orte/mca/routed/routed.h"
|
|
#include "orte/mca/routed/base/base.h"
|
|
|
|
|
|
/* The following file was created by configure. It contains extern
|
|
* statements and the definition of an array of pointers to each
|
|
* component's public mca_base_component_t struct. */
|
|
#include "orte/mca/routed/base/static-components.h"
|
|
|
|
|
|
int orte_routed_base_output = -1;
|
|
orte_routed_module_t orte_routed;
|
|
opal_list_t orte_routed_base_components;
|
|
|
|
static orte_routed_component_t *active_component = NULL;
|
|
static bool component_open_called = false;
|
|
|
|
int
|
|
orte_routed_base_open(void)
|
|
{
|
|
int ret;
|
|
|
|
/* setup the output stream */
|
|
orte_routed_base_output = opal_output_open(NULL);
|
|
|
|
/* Initialize globals */
|
|
OBJ_CONSTRUCT(&orte_routed_base_components, opal_list_t);
|
|
|
|
/* Open up all available components */
|
|
ret = mca_base_components_open("routed",
|
|
orte_routed_base_output,
|
|
mca_routed_base_static_components,
|
|
&orte_routed_base_components,
|
|
true);
|
|
component_open_called = true;
|
|
|
|
return ret;
|
|
}
|
|
|
|
|
|
int
|
|
orte_routed_base_select(void)
|
|
{
|
|
int ret, exit_status = OPAL_SUCCESS;
|
|
orte_routed_component_t *best_component = NULL;
|
|
orte_routed_module_t *best_module = NULL;
|
|
|
|
/*
|
|
* Select the best component
|
|
*/
|
|
if( OPAL_SUCCESS != mca_base_select("routed", orte_routed_base_output,
|
|
&orte_routed_base_components,
|
|
(mca_base_module_t **) &best_module,
|
|
(mca_base_component_t **) &best_component) ) {
|
|
/* This will only happen if no component was selected */
|
|
exit_status = ORTE_ERR_NOT_FOUND;
|
|
goto cleanup;
|
|
}
|
|
|
|
/* Save the winner */
|
|
orte_routed = *best_module;
|
|
active_component = best_component;
|
|
|
|
/* initialize the selected component */
|
|
opal_output_verbose(10, orte_routed_base_output,
|
|
"orte_routed_base_select: initializing selected component %s",
|
|
best_component->base_version.mca_component_name);
|
|
if (ORTE_SUCCESS != (ret = orte_routed.initialize()) ) {
|
|
exit_status = ret;
|
|
goto cleanup;
|
|
}
|
|
|
|
cleanup:
|
|
return exit_status;
|
|
}
|
|
|
|
|
|
int
|
|
orte_routed_base_close(void)
|
|
{
|
|
/* finalize the selected component */
|
|
if (NULL != orte_routed.finalize) {
|
|
orte_routed.finalize();
|
|
}
|
|
|
|
/* shutdown any remaining opened components */
|
|
if (component_open_called) {
|
|
mca_base_components_close(orte_routed_base_output,
|
|
&orte_routed_base_components, NULL);
|
|
}
|
|
|
|
OBJ_DESTRUCT(&orte_routed_base_components);
|
|
|
|
return ORTE_SUCCESS;
|
|
}
|