e7ecd56bd2
such, the commit message back to the master SVN repository is fairly long. = ORTE Job-Level Output Messages = Add two new interfaces that should be used for all new code throughout the ORTE and OMPI layers (we already make the search-and-replace on the existing ORTE / OMPI layers): * orte_output(): (and corresponding friends ORTE_OUTPUT, orte_output_verbose, etc.) This function sends the output directly to the HNP for processing as part of a job-specific output channel. It supports all the same outputs as opal_output() (syslog, file, stdout, stderr), but for stdout/stderr, the output is sent to the HNP for processing and output. More on this below. * orte_show_help(): This function is a drop-in-replacement for opal_show_help(), with two differences in functionality: 1. the rendered text help message output is sent to the HNP for display (rather than outputting directly into the process' stderr stream) 1. the HNP detects duplicate help messages and does not display them (so that you don't see the same error message N times, once from each of your N MPI processes); instead, it counts "new" instances of the help message and displays a message every ~5 seconds when there are new ones ("I got X new copies of the help message...") opal_show_help and opal_output still exist, but they only output in the current process. The intent for the new orte_* functions is that they can apply job-level intelligence to the output. As such, we recommend that all new ORTE and OMPI code use the new orte_* functions, not thei opal_* functions. === New code === For ORTE and OMPI programmers, here's what you need to do differently in new code: * Do not include opal/util/show_help.h or opal/util/output.h. Instead, include orte/util/output.h (this one header file has declarations for both the orte_output() series of functions and orte_show_help()). * Effectively s/opal_output/orte_output/gi throughout your code. Note that orte_output_open() takes a slightly different argument list (as a way to pass data to the filtering stream -- see below), so you if explicitly call opal_output_open(), you'll need to slightly adapt to the new signature of orte_output_open(). * Literally s/opal_show_help/orte_show_help/. The function signature is identical. === Notes === * orte_output'ing to stream 0 will do similar to what opal_output'ing did, so leaving a hard-coded "0" as the first argument is safe. * For systems that do not use ORTE's RML or the HNP, the effect of orte_output_* and orte_show_help will be identical to their opal counterparts (the additional information passed to orte_output_open() will be lost!). Indeed, the orte_* functions simply become trivial wrappers to their opal_* counterparts. Note that we have not tested this; the code is simple but it is quite possible that we mucked something up. = Filter Framework = Messages sent view the new orte_* functions described above and messages output via the IOF on the HNP will now optionally be passed through a new "filter" framework before being output to stdout/stderr. The "filter" OPAL MCA framework is intended to allow preprocessing to messages before they are sent to their final destinations. The first component that was written in the filter framework was to create an XML stream, segregating all the messages into different XML tags, etc. This will allow 3rd party tools to read the stdout/stderr from the HNP and be able to know exactly what each text message is (e.g., a help message, another OMPI infrastructure message, stdout from the user process, stderr from the user process, etc.). Filtering is not active by default. Filter components must be specifically requested, such as: {{{ $ mpirun --mca filter xml ... }}} There can only be one filter component active. = New MCA Parameters = The new functionality described above introduces two new MCA parameters: * '''orte_base_help_aggregate''': Defaults to 1 (true), meaning that help messages will be aggregated, as described above. If set to 0, all help messages will be displayed, even if they are duplicates (i.e., the original behavior). * '''orte_base_show_output_recursions''': An MCA parameter to help debug one of the known issues, described below. It is likely that this MCA parameter will disappear before v1.3 final. = Known Issues = * The XML filter component is not complete. The current output from this component is preliminary and not real XML. A bit more work needs to be done to configure.m4 search for an appropriate XML library/link it in/use it at run time. * There are possible recursion loops in the orte_output() and orte_show_help() functions -- e.g., if RML send calls orte_output() or orte_show_help(). We have some ideas how to fix these, but figured that it was ok to commit before feature freeze with known issues. The code currently contains sub-optimal workarounds so that this will not be a problem, but it would be good to actually solve the problem rather than have hackish workarounds before v1.3 final. This commit was SVN r18434.
140 строки
4.3 KiB
C
140 строки
4.3 KiB
C
/*
|
|
* Copyright (c) 2004-2008 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 "orte_config.h"
|
|
#include "orte/constants.h"
|
|
|
|
#include "opal/mca/mca.h"
|
|
#include "opal/mca/base/base.h"
|
|
|
|
#include "orte/util/output.h"
|
|
#include "opal/mca/base/mca_base_param.h"
|
|
|
|
#include "orte/mca/filem/filem.h"
|
|
#include "orte/mca/filem/base/base.h"
|
|
|
|
|
|
static orte_filem_base_component_t none_component = {
|
|
/* Handle the general mca_component_t struct containing
|
|
* meta information about the component itself
|
|
*/
|
|
{
|
|
ORTE_FILEM_BASE_VERSION_1_0_0,
|
|
/* Component name and version */
|
|
"none",
|
|
OMPI_MAJOR_VERSION,
|
|
OMPI_MINOR_VERSION,
|
|
OMPI_RELEASE_VERSION,
|
|
|
|
/* Component open and close functions */
|
|
orte_filem_base_none_open,
|
|
orte_filem_base_none_close,
|
|
orte_filem_base_none_query
|
|
},
|
|
|
|
/* Next the MCA v1.0.0 component meta data */
|
|
{
|
|
/* Is the component checkpointable ? */
|
|
true
|
|
},
|
|
|
|
/* Verbosity level */
|
|
0,
|
|
/* orte_output handler */
|
|
-1,
|
|
/* Default priority */
|
|
1
|
|
};
|
|
|
|
static orte_filem_base_module_t none_module = {
|
|
/** Initialization Function */
|
|
orte_filem_base_module_init,
|
|
/** Finalization Function */
|
|
orte_filem_base_module_finalize,
|
|
|
|
orte_filem_base_none_put,
|
|
orte_filem_base_none_get,
|
|
orte_filem_base_none_rm
|
|
};
|
|
|
|
int orte_filem_base_select(void)
|
|
{
|
|
int ret, exit_status = OPAL_SUCCESS;
|
|
orte_filem_base_component_t *best_component = NULL;
|
|
orte_filem_base_module_t *best_module = NULL;
|
|
char *include_list = NULL;
|
|
|
|
/*
|
|
* Register the framework MCA param and look up include list
|
|
*/
|
|
mca_base_param_reg_string_name("filem", NULL,
|
|
"Which FILEM component to use (empty = auto-select)",
|
|
false, false,
|
|
NULL, &include_list);
|
|
|
|
/* If we do not have any components to select this is ok. The user likely
|
|
* decided not to build with filem components. Just use the none
|
|
* component and move on.
|
|
*/
|
|
if( 0 >= opal_list_get_size(&orte_filem_base_components_available) ||
|
|
(NULL != include_list && 0 == strncmp(include_list, "none", strlen("none")) ) ) {
|
|
orte_output_verbose(1, orte_filem_base_output,
|
|
"filem:select: Warning: Using none component. Some functionality (e.g., --preload-binary) will not work in this mode.");
|
|
best_component = &none_component;
|
|
best_module = &none_module;
|
|
|
|
/* JJH: Todo: Check if none is in the list */
|
|
/* Close all components since none will be used */
|
|
mca_base_components_close(0, /* Pass 0 to keep this from closing the output handle */
|
|
&orte_filem_base_components_available,
|
|
NULL);
|
|
goto skip_select;
|
|
}
|
|
|
|
/*
|
|
* Select the best component
|
|
*/
|
|
if( OPAL_SUCCESS != (ret = mca_base_select("filem", orte_filem_base_output,
|
|
&orte_filem_base_components_available,
|
|
(mca_base_module_t **) &best_module,
|
|
(mca_base_component_t **) &best_component) ) ) {
|
|
/* This will only happen if no component was selected */
|
|
exit_status = ORTE_ERROR;
|
|
goto cleanup;
|
|
}
|
|
|
|
skip_select:
|
|
/* Save the winner */
|
|
orte_filem_base_selected_component = *best_component;
|
|
orte_filem = *best_module;
|
|
|
|
/* Initialize the winner */
|
|
if (NULL != best_module) {
|
|
if (OPAL_SUCCESS != orte_filem.filem_init()) {
|
|
exit_status = OPAL_ERROR;
|
|
goto cleanup;
|
|
}
|
|
}
|
|
|
|
cleanup:
|
|
if( NULL != include_list ) {
|
|
free(include_list);
|
|
include_list = NULL;
|
|
}
|
|
|
|
return exit_status;
|
|
}
|