Remove the tags from orte_output_open and the filtering operation from orte_output - this will be handled differently to improve the XML output interface
This commit was SVN r18557.
Этот коммит содержится в:
родитель
95578b0528
Коммит
c992e99035
@ -97,7 +97,7 @@ int mca_btl_base_open(void)
|
||||
0,
|
||||
&mca_btl_base_verbose);
|
||||
|
||||
mca_btl_base_output = orte_output_open(NULL, "BTL", "DEBUG", NULL);
|
||||
mca_btl_base_output = orte_output_open(NULL);
|
||||
orte_output_set_verbosity(mca_btl_base_output, mca_btl_base_verbose);
|
||||
|
||||
/* Open up all available components */
|
||||
|
@ -98,7 +98,7 @@ mca_btl_portals_component_open(void)
|
||||
asprintf(&(portals_output_stream.lds_prefix),
|
||||
"btl: portals (%s): ", ompi_common_portals_nodeid());
|
||||
mca_btl_portals_component.portals_output =
|
||||
orte_output_open(&portals_output_stream, "BTL", "PORTALS", "DEBUG", NULL);
|
||||
orte_output_open(&portals_output_stream);
|
||||
|
||||
mca_base_param_reg_int(&mca_btl_portals_component.super.btl_version,
|
||||
"free_list_init_num",
|
||||
|
@ -64,7 +64,7 @@ int mca_coll_base_open(void)
|
||||
{
|
||||
/* Open an output stream for this framework */
|
||||
|
||||
mca_coll_base_output = orte_output_open(NULL, "COLL", "DEBUG", NULL);
|
||||
mca_coll_base_output = orte_output_open(NULL);
|
||||
|
||||
/* Open up all available components */
|
||||
|
||||
|
@ -130,7 +130,7 @@ static int tuned_open(void)
|
||||
int verbose;
|
||||
mca_base_param_lookup_int(param, &verbose);
|
||||
if (verbose > 0) {
|
||||
ompi_coll_tuned_stream = orte_output_open(NULL, "COLL", "TUNED", "DEBUG", NULL);
|
||||
ompi_coll_tuned_stream = orte_output_open(NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ int ompi_crcp_base_open(void)
|
||||
{
|
||||
char *str_value = NULL;
|
||||
|
||||
ompi_crcp_base_output = orte_output_open(NULL, "CRCP", "DEBUG", NULL);
|
||||
ompi_crcp_base_output = orte_output_open(NULL);
|
||||
|
||||
/*
|
||||
* Which CRCP component to open
|
||||
|
@ -100,7 +100,7 @@ static int crcp_coord_open(void)
|
||||
* otherwise take our parents level and output channel
|
||||
*/
|
||||
if ( 0 != mca_crcp_coord_component.super.verbose) {
|
||||
mca_crcp_coord_component.super.output_handle = orte_output_open(NULL, "CRCP", "COORD", "DEBUG", NULL);
|
||||
mca_crcp_coord_component.super.output_handle = orte_output_open(NULL);
|
||||
orte_output_set_verbosity(mca_crcp_coord_component.super.output_handle,
|
||||
mca_crcp_coord_component.super.verbose);
|
||||
} else {
|
||||
|
@ -44,7 +44,7 @@ ompi_dpm_base_component_t ompi_dpm_base_selected_component;
|
||||
int ompi_dpm_base_open(void)
|
||||
{
|
||||
/* Debugging/Verbose output */
|
||||
ompi_dpm_base_output = orte_output_open(NULL, "DPM", "DEBUG", NULL);
|
||||
ompi_dpm_base_output = orte_output_open(NULL);
|
||||
|
||||
/* Open up all available components */
|
||||
if (OPAL_SUCCESS !=
|
||||
|
@ -66,7 +66,7 @@ int mca_io_base_open(void)
|
||||
{
|
||||
/* Open an output stream for this framework */
|
||||
|
||||
mca_io_base_output = orte_output_open(NULL, "IO", "DEBUG", NULL);
|
||||
mca_io_base_output = orte_output_open(NULL);
|
||||
|
||||
/* Create some parameters */
|
||||
|
||||
|
@ -126,7 +126,7 @@ static int mca_mpool_sm_open(void)
|
||||
"Enable verbose output for mpool sm component",
|
||||
false, false, 0, &value);
|
||||
if (value != 0) {
|
||||
mca_mpool_sm_component.verbose = orte_output_open(NULL, "MPOOL", "SM", "DEBUG", NULL);
|
||||
mca_mpool_sm_component.verbose = orte_output_open(NULL);
|
||||
} else {
|
||||
mca_mpool_sm_component.verbose = -1;
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ int
|
||||
ompi_mtl_base_open(void)
|
||||
{
|
||||
/* setup the output stream */
|
||||
ompi_mtl_base_output = orte_output_open(NULL, "MTL", "DEBUG", NULL);
|
||||
ompi_mtl_base_output = orte_output_open(NULL);
|
||||
|
||||
/* Open up all available components */
|
||||
if (OMPI_SUCCESS !=
|
||||
|
@ -115,7 +115,7 @@ ompi_mtl_portals_component_open(void)
|
||||
asprintf(&(mtl_portals_output_stream.lds_prefix),
|
||||
"btl: portals (%s): ", ompi_common_portals_nodeid());
|
||||
ompi_mtl_portals.portals_output =
|
||||
orte_output_open(&mtl_portals_output_stream, "MTL", "PORTALS", "DEBUG", NULL);
|
||||
orte_output_open(&mtl_portals_output_stream);
|
||||
|
||||
|
||||
|
||||
|
@ -51,7 +51,7 @@ ompi_osc_base_open(void)
|
||||
int ret;
|
||||
|
||||
/* setup the output stream */
|
||||
ompi_osc_base_output = orte_output_open(NULL, "OSC", "DEBUG", NULL);
|
||||
ompi_osc_base_output = orte_output_open(NULL);
|
||||
|
||||
/* initialize the base code */
|
||||
OBJ_CONSTRUCT(&ompi_osc_base_open_components, opal_list_t);
|
||||
|
@ -102,7 +102,7 @@ int mca_pml_base_open(void)
|
||||
false, false,
|
||||
0, &value);
|
||||
|
||||
mca_pml_base_output = orte_output_open(NULL, "PML", "DEBUG", NULL);
|
||||
mca_pml_base_output = orte_output_open(NULL);
|
||||
orte_output_set_verbosity(mca_pml_base_output, value);
|
||||
|
||||
/* Open up all available components */
|
||||
|
@ -93,7 +93,7 @@ int mca_pml_crcpw_component_open(void)
|
||||
mca_pml_crcpw_component.verbose,
|
||||
&mca_pml_crcpw_component.verbose);
|
||||
|
||||
mca_pml_crcpw_component.output_handle = orte_output_open(NULL, "PML", "CRCPW", "DEBUG", NULL);
|
||||
mca_pml_crcpw_component.output_handle = orte_output_open(NULL);
|
||||
if ( 0 != mca_pml_crcpw_component.verbose) {
|
||||
orte_output_set_verbosity(mca_pml_crcpw_component.output_handle,
|
||||
mca_pml_crcpw_component.verbose);
|
||||
|
@ -47,7 +47,7 @@ int pml_v_output_open(char *output, int verbosity) {
|
||||
gethostname(hostname, 32);
|
||||
asprintf(&lds.lds_prefix, "[%s:%05d] pml_v: ", hostname, getpid());
|
||||
lds.lds_verbose_level = verbosity;
|
||||
pml_v_output = orte_output_open(&lds, "PML", "V", "DEBUG", NULL);
|
||||
pml_v_output = orte_output_open(&lds);
|
||||
free(lds.lds_prefix);
|
||||
}
|
||||
return pml_v_output;
|
||||
|
@ -44,7 +44,7 @@ ompi_pubsub_base_component_t ompi_pubsub_base_selected_component;
|
||||
int ompi_pubsub_base_open(void)
|
||||
{
|
||||
/* Debugging/Verbose output */
|
||||
ompi_pubsub_base_output = orte_output_open(NULL, "PUBSUB", "DEBUG", NULL);
|
||||
ompi_pubsub_base_output = orte_output_open(NULL);
|
||||
|
||||
/* Open up all available components */
|
||||
if (OPAL_SUCCESS !=
|
||||
|
@ -60,7 +60,7 @@ bool mca_topo_base_components_opened_valid = false;
|
||||
int mca_topo_base_open(void)
|
||||
{
|
||||
/* Open the topo framework output stream */
|
||||
mca_topo_base_output = orte_output_open(NULL, "TOPO", "DEBUG", NULL);
|
||||
mca_topo_base_output = orte_output_open(NULL);
|
||||
|
||||
/* Open up all available components */
|
||||
if (OMPI_SUCCESS !=
|
||||
|
@ -153,7 +153,7 @@ int ompi_cr_init(void)
|
||||
0,
|
||||
&val);
|
||||
if(0 != val) {
|
||||
ompi_cr_output = orte_output_open(NULL, "OMPI", "CR", "DEBUG", NULL);
|
||||
ompi_cr_output = orte_output_open(NULL);
|
||||
orte_output_set_verbosity(ompi_cr_output, val);
|
||||
} else {
|
||||
ompi_cr_output = opal_cr_output;
|
||||
|
@ -76,7 +76,7 @@ int orte_errmgr_base_open(void)
|
||||
|
||||
if (!orte_errmgr_initialized) { /* ensure we only do this once */
|
||||
|
||||
orte_errmgr_base_output = orte_output_open(NULL, "ERRMGR", "DEBUG", NULL);
|
||||
orte_errmgr_base_output = orte_output_open(NULL);
|
||||
|
||||
/* Open up all available components */
|
||||
|
||||
|
@ -49,7 +49,7 @@ int orte_ess_base_output;
|
||||
int
|
||||
orte_ess_base_open(void)
|
||||
{
|
||||
orte_ess_base_output = orte_output_open(NULL, "ESS", "DEBUG", NULL);
|
||||
orte_ess_base_output = orte_output_open(NULL);
|
||||
|
||||
OBJ_CONSTRUCT(&orte_ess_base_components_available, opal_list_t);
|
||||
|
||||
|
@ -52,7 +52,7 @@ int orte_filem_base_open(void)
|
||||
{
|
||||
char *str_value = NULL;
|
||||
|
||||
orte_filem_base_output = orte_output_open(NULL, "FILEM", "DEBUG", NULL);
|
||||
orte_filem_base_output = orte_output_open(NULL);
|
||||
|
||||
/*
|
||||
* Which FileM component to open
|
||||
|
@ -104,7 +104,7 @@ static int filem_rsh_open(void)
|
||||
* otherwise take our parents level and output channel
|
||||
*/
|
||||
if ( 0 != mca_filem_rsh_component.super.verbose) {
|
||||
mca_filem_rsh_component.super.output_handle = orte_output_open(NULL, "FILEM", "RSH", "DEBUG", NULL);
|
||||
mca_filem_rsh_component.super.output_handle = orte_output_open(NULL);
|
||||
orte_output_set_verbosity(mca_filem_rsh_component.super.output_handle,
|
||||
mca_filem_rsh_component.super.verbose);
|
||||
} else {
|
||||
|
@ -56,7 +56,7 @@ int orte_grpcomm_base_open(void)
|
||||
{
|
||||
/* Debugging / verbose output. Always have stream open, with
|
||||
verbose set by the mca open system... */
|
||||
orte_grpcomm_base_output = orte_output_open(NULL, "GRPCOMM", "DEBUG", NULL);
|
||||
orte_grpcomm_base_output = orte_output_open(NULL);
|
||||
|
||||
/* Open up all available components */
|
||||
|
||||
|
@ -86,7 +86,7 @@ int orte_iof_base_open(void)
|
||||
orte_util_convert_string_to_process_name(&orte_iof_base.iof_service, str_value);
|
||||
free(str_value);
|
||||
|
||||
orte_iof_base.iof_output = orte_output_open(NULL, "IOF", "DEBUG", NULL);
|
||||
orte_iof_base.iof_output = orte_output_open(NULL);
|
||||
|
||||
/* initialize free list */
|
||||
opal_free_list_init( &orte_iof_base.iof_fragments,
|
||||
|
@ -143,7 +143,7 @@ int orte_odls_base_open(void)
|
||||
{
|
||||
/* Debugging / verbose output. Always have stream open, with
|
||||
verbose set by the mca open system... */
|
||||
orte_odls_globals.output = orte_output_open(NULL, "ODLS", "DEBUG", NULL);
|
||||
orte_odls_globals.output = orte_output_open(NULL);
|
||||
|
||||
mca_base_param_reg_int_name("odls", "base_sigkill_timeout",
|
||||
"Time to wait for a process to die after issuing a kill signal to it",
|
||||
|
@ -65,7 +65,7 @@ int mca_oob_base_open(void)
|
||||
}
|
||||
|
||||
/* register parameters */
|
||||
mca_oob_base_output = orte_output_open(NULL, "OOB", "DEBUG", NULL);
|
||||
mca_oob_base_output = orte_output_open(NULL);
|
||||
|
||||
/* Open up all available components */
|
||||
OBJ_CONSTRUCT(&mca_oob_base_components, opal_list_t);
|
||||
|
@ -207,7 +207,7 @@ int mca_oob_tcp_component_open(void)
|
||||
false, false,
|
||||
0,
|
||||
&value);
|
||||
mca_oob_tcp_output_handle = orte_output_open(NULL, "OOB", "TCP", "DEBUG", NULL);
|
||||
mca_oob_tcp_output_handle = orte_output_open(NULL);
|
||||
orte_output_set_verbosity(mca_oob_tcp_output_handle, value);
|
||||
|
||||
OBJ_CONSTRUCT(&mca_oob_tcp_component.tcp_peer_list, opal_list_t);
|
||||
|
@ -75,7 +75,7 @@ int orte_plm_base_open(void)
|
||||
{
|
||||
/* Debugging / verbose output. Always have stream open, with
|
||||
verbose set by the mca open system... */
|
||||
orte_plm_globals.output = orte_output_open(NULL, "PLM", "DEBUG", NULL);
|
||||
orte_plm_globals.output = orte_output_open(NULL);
|
||||
|
||||
/* init selected to be false */
|
||||
orte_plm_base.selected = false;
|
||||
|
@ -38,7 +38,6 @@ BEGIN_C_DECLS
|
||||
*/
|
||||
typedef struct orte_ras_base_t {
|
||||
int ras_output;
|
||||
int alloc_output;
|
||||
opal_list_t ras_opened;
|
||||
bool allocation_read;
|
||||
bool display_alloc;
|
||||
|
@ -47,7 +47,6 @@ int orte_ras_base_allocate(orte_job_t *jdata)
|
||||
orte_std_cntr_t i;
|
||||
bool override_oversubscribed;
|
||||
orte_app_context_t **apps;
|
||||
char *output;
|
||||
|
||||
ORTE_OUTPUT_VERBOSE((5, orte_ras_base.ras_output,
|
||||
"%s ras:base:allocate",
|
||||
@ -290,12 +289,7 @@ DISPLAY:
|
||||
if (NULL == alloc[i]) {
|
||||
break;
|
||||
}
|
||||
if (ORTE_SUCCESS != (rc = opal_dss.print(&output, NULL, alloc[i], ORTE_NODE))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
orte_output(orte_ras_base.alloc_output, "%s", output);
|
||||
free(output);
|
||||
opal_dss.dump(orte_ras_base.ras_output, alloc[i], ORTE_NODE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -78,8 +78,7 @@ int orte_ras_base_open(void)
|
||||
|
||||
/* Debugging / verbose output. Always have stream open, with
|
||||
verbose set by the mca open system... */
|
||||
orte_ras_base.ras_output = orte_output_open(NULL, "RAS", "DEBUG", NULL);
|
||||
orte_ras_base.alloc_output = orte_output_open(NULL, "RAS", "ALLOC", NULL);
|
||||
orte_ras_base.ras_output = orte_output_open(NULL);
|
||||
|
||||
/* Open up all available components */
|
||||
if (ORTE_SUCCESS !=
|
||||
|
@ -94,7 +94,7 @@ static int orte_ras_gridengine_open(void)
|
||||
false, false, 0, &mca_ras_gridengine_component.show_jobid);
|
||||
|
||||
if (value != 0) {
|
||||
mca_ras_gridengine_component.verbose = orte_output_open(NULL, "RAS", "GRIDENGINE", "DEBUG", NULL);
|
||||
mca_ras_gridengine_component.verbose = orte_output_open(NULL);
|
||||
} else {
|
||||
mca_ras_gridengine_component.verbose = -1;
|
||||
}
|
||||
|
@ -45,7 +45,6 @@ BEGIN_C_DECLS
|
||||
typedef struct {
|
||||
/** Verbose/debug output stream */
|
||||
int rmaps_output;
|
||||
int map_output;
|
||||
/** List of available components */
|
||||
opal_list_t available_components;
|
||||
/** selected module */
|
||||
|
@ -91,11 +91,7 @@ int orte_rmaps_base_map_job(orte_job_t *jdata)
|
||||
|
||||
/* if we wanted to display the map, now is the time to do it */
|
||||
if (jdata->map->display_map) {
|
||||
if (ORTE_SUCCESS != (rc = opal_dss.print(&output, NULL, jdata->map, ORTE_JOB_MAP))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto CLEANUP;
|
||||
}
|
||||
orte_output(orte_rmaps_base.map_output, "%s", output);
|
||||
opal_dss.dump(orte_rmaps_base.rmaps_output, jdata->map, ORTE_JOB_MAP);
|
||||
}
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
|
@ -69,8 +69,7 @@ int orte_rmaps_base_open(void)
|
||||
|
||||
/* Debugging / verbose output. Always have stream open, with
|
||||
verbose set by the mca open system... */
|
||||
orte_rmaps_base.rmaps_output = orte_output_open(NULL, "RMAPS", "DEBUG", NULL);
|
||||
orte_rmaps_base.map_output = orte_output_open(NULL, "RMAPS", "MAP", NULL);
|
||||
orte_rmaps_base.rmaps_output = orte_output_open(NULL);
|
||||
|
||||
/* Are we scheduling by node or by slot? */
|
||||
param = mca_base_param_reg_string_name("rmaps", "base_schedule_policy",
|
||||
|
@ -56,7 +56,7 @@ orte_rml_base_open(void)
|
||||
NULL, NULL);
|
||||
|
||||
/* register parameters */
|
||||
orte_rml_base_output = orte_output_open(NULL, "RML", "DEBUG", NULL);
|
||||
orte_rml_base_output = orte_output_open(NULL);
|
||||
|
||||
/* Open up all available components */
|
||||
ret = mca_base_components_open("rml",
|
||||
|
@ -157,7 +157,7 @@ static int orte_rml_ftrm_open(void)
|
||||
* otherwise take our parents level and output channel
|
||||
*/
|
||||
if ( 0 != value) {
|
||||
rml_ftrm_output_handle = orte_output_open(NULL, "RML", "FTRM", "DEBUG", NULL);
|
||||
rml_ftrm_output_handle = orte_output_open(NULL);
|
||||
orte_output_set_verbosity(rml_ftrm_output_handle, value);
|
||||
} else {
|
||||
rml_ftrm_output_handle = -1;
|
||||
|
@ -43,7 +43,7 @@ orte_routed_base_open(void)
|
||||
int ret;
|
||||
|
||||
/* setup the output stream */
|
||||
orte_routed_base_output = orte_output_open(NULL, "ROUTED", "DEBUG", NULL);
|
||||
orte_routed_base_output = orte_output_open(NULL);
|
||||
|
||||
/* Initialize globals */
|
||||
OBJ_CONSTRUCT(&orte_routed_base_components, opal_list_t);
|
||||
|
@ -67,7 +67,7 @@ int orte_snapc_base_open(void)
|
||||
ORTE_OUTPUT_VERBOSE((10, orte_snapc_base_output,
|
||||
"snapc:base: open()"));
|
||||
|
||||
orte_snapc_base_output = orte_output_open(NULL, "SNAPC", "DEBUG", NULL);
|
||||
orte_snapc_base_output = orte_output_open(NULL);
|
||||
|
||||
/* Global Snapshot directory */
|
||||
mca_base_param_reg_string_name("snapc",
|
||||
|
@ -101,7 +101,7 @@ static int snapc_full_open(void)
|
||||
* otherwise take our parents level and output channel
|
||||
*/
|
||||
if ( 0 != mca_snapc_full_component.super.verbose) {
|
||||
mca_snapc_full_component.super.output_handle = orte_output_open(NULL, "SNAPC", "FULL", "DEBUG", NULL);
|
||||
mca_snapc_full_component.super.output_handle = orte_output_open(NULL);
|
||||
orte_output_set_verbosity(mca_snapc_full_component.super.output_handle,
|
||||
mca_snapc_full_component.super.verbose);
|
||||
} else {
|
||||
|
@ -123,7 +123,7 @@ int orte_cr_init(void)
|
||||
*/
|
||||
|
||||
if(0 != val) {
|
||||
orte_cr_output = orte_output_open(NULL, "ORTE", "CR", "DEBUG", NULL);
|
||||
orte_cr_output = orte_output_open(NULL);
|
||||
orte_output_set_verbosity(orte_cr_output, val);
|
||||
} else {
|
||||
orte_cr_output = opal_cr_output;
|
||||
|
@ -97,7 +97,7 @@ int orte_dt_init(void)
|
||||
opal_data_type_t tmp;
|
||||
|
||||
/* set default output */
|
||||
orte_debug_output = orte_output_open(NULL, "ORTE", "DEBUG", NULL);
|
||||
orte_debug_output = orte_output_open(NULL);
|
||||
/* open up the verbose output for ORTE debugging */
|
||||
if (orte_debug_flag || 0 < orte_debug_verbosity ||
|
||||
(orte_debug_daemons_flag && (orte_process_info.daemon || orte_process_info.hnp))) {
|
||||
|
@ -19,7 +19,7 @@ int main(int argc, char* argv[])
|
||||
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
|
||||
MPI_Comm_size(MPI_COMM_WORLD, &size);
|
||||
|
||||
stream = orte_output_open(NULL, "HELLO", "OUTPUT", NULL);
|
||||
stream = orte_output_open(NULL);
|
||||
orte_output(stream, "(stream) Hello, World, I am %d of %d\n", rank, size);
|
||||
|
||||
printf("(printf) Hello, World, I am %d of %d\n", rank, size);
|
||||
|
@ -440,7 +440,7 @@ static int ckpt_init(int argc, char *argv[]) {
|
||||
* Setup OPAL Output handle from the verbose argument
|
||||
*/
|
||||
if( orte_checkpoint_globals.verbose ) {
|
||||
orte_checkpoint_globals.output = orte_output_open(NULL, "ORTE", "CHECKPOINT", "DEBUG", NULL);
|
||||
orte_checkpoint_globals.output = orte_output_open(NULL);
|
||||
orte_output_set_verbosity(orte_checkpoint_globals.output, 10);
|
||||
} else {
|
||||
orte_checkpoint_globals.output = 0; /* Default=STDERR */
|
||||
|
@ -347,7 +347,7 @@ static int orte_ps_init(int argc, char *argv[]) {
|
||||
* Setup OPAL Output handle from the verbose argument
|
||||
*/
|
||||
if( orte_ps_globals.verbose ) {
|
||||
orte_ps_globals.output = orte_output_open(NULL, "ORTE", "PS", "DEBUG", NULL);
|
||||
orte_ps_globals.output = orte_output_open(NULL);
|
||||
orte_output_set_verbosity(orte_ps_globals.output, 10);
|
||||
} else {
|
||||
orte_ps_globals.output = 0; /* Default=STDERR */
|
||||
|
@ -251,7 +251,7 @@ static int initialize(int argc, char *argv[]) {
|
||||
* Setup OPAL Output handle from the verbose argument
|
||||
*/
|
||||
if( orte_restart_globals.verbose ) {
|
||||
orte_restart_globals.output = orte_output_open(NULL, "ORTE", "RESTART", "DEBUG", NULL);
|
||||
orte_restart_globals.output = orte_output_open(NULL);
|
||||
orte_output_set_verbosity(orte_restart_globals.output, 10);
|
||||
} else {
|
||||
orte_restart_globals.output = 0; /* Default=STDERR */
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include "opal/util/output.h"
|
||||
#include "opal/util/printf.h"
|
||||
#include "opal/dss/dss.h"
|
||||
#include "opal/mca/filter/filter.h"
|
||||
|
||||
#include "orte/mca/errmgr/errmgr.h"
|
||||
#include "orte/mca/rml/rml.h"
|
||||
@ -105,7 +104,7 @@ void orte_output_finalize(void)
|
||||
return;
|
||||
}
|
||||
|
||||
int orte_output_open(opal_output_stream_t *lds, const char *primary_tag, ...)
|
||||
int orte_output_open(opal_output_stream_t *lds)
|
||||
{
|
||||
return opal_output_open(lds);
|
||||
}
|
||||
@ -169,35 +168,6 @@ int orte_show_help(const char *filename, const char *topic,
|
||||
|
||||
#define ORTE_OUTPUT_MAX_TAGS 10
|
||||
|
||||
/* struct to store stream-specific data */
|
||||
typedef struct {
|
||||
opal_object_t super;
|
||||
uint8_t flags;
|
||||
int num_tags;
|
||||
char *tags[ORTE_OUTPUT_MAX_TAGS];
|
||||
} orte_output_stream_t;
|
||||
|
||||
static void orte_output_stream_constructor(orte_output_stream_t *ptr)
|
||||
{
|
||||
ptr->flags = ORTE_OUTPUT_OTHER;
|
||||
ptr->num_tags = 0;
|
||||
memset(ptr->tags, 0, ORTE_OUTPUT_MAX_TAGS*sizeof(char*));
|
||||
}
|
||||
static void orte_output_stream_destructor(orte_output_stream_t *ptr)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0; i < ORTE_OUTPUT_MAX_TAGS; i++) {
|
||||
if (NULL != ptr->tags[i]) {
|
||||
free(ptr->tags[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OBJ_CLASS_INSTANCE(orte_output_stream_t, opal_object_t,
|
||||
orte_output_stream_constructor,
|
||||
orte_output_stream_destructor);
|
||||
|
||||
/* List items for holding process names */
|
||||
typedef struct {
|
||||
opal_list_item_t super;
|
||||
@ -246,7 +216,7 @@ static opal_event_t show_help_timer_event;
|
||||
/* Local static variables */
|
||||
static int stdout_stream, stderr_stream;
|
||||
static opal_output_stream_t stdout_lds, stderr_lds, orte_output_default;
|
||||
static opal_pointer_array_t orte_output_streams;
|
||||
static opal_value_array_t orte_output_streams;
|
||||
static bool orte_output_ready = false;
|
||||
static bool suppress_warnings = false;
|
||||
static bool am_inside = false;
|
||||
@ -326,33 +296,13 @@ static int get_tli(const char *filename, const char *topic,
|
||||
}
|
||||
|
||||
|
||||
static void new_stream_tracker(int stream, uint8_t flag, const char *primary_tag, va_list arglist)
|
||||
{
|
||||
orte_output_stream_t *ptr;
|
||||
char *tag;
|
||||
|
||||
ptr = OBJ_NEW(orte_output_stream_t);
|
||||
ptr->flags = flag;
|
||||
ptr->num_tags = 1;
|
||||
ptr->tags[0] = strdup(primary_tag);
|
||||
if (NULL != arglist) {
|
||||
while (NULL != (tag = va_arg(arglist, char*))) {
|
||||
ptr->tags[ptr->num_tags] = strdup(tag);
|
||||
ptr->num_tags++;
|
||||
}
|
||||
}
|
||||
opal_pointer_array_set_item(&orte_output_streams, stream, ptr);
|
||||
}
|
||||
|
||||
|
||||
static void output_vverbose(int verbose_level, int output_id,
|
||||
int major_id, int minor_id,
|
||||
const char *format, va_list arglist)
|
||||
{
|
||||
char *output = NULL, *filtered = NULL;
|
||||
char *output = NULL;
|
||||
opal_buffer_t buf;
|
||||
uint8_t flag;
|
||||
orte_output_stream_t **streams;
|
||||
uint8_t flags;
|
||||
int rc;
|
||||
|
||||
if (output_id < 0) {
|
||||
@ -375,15 +325,6 @@ static void output_vverbose(int verbose_level, int output_id,
|
||||
return;
|
||||
}
|
||||
|
||||
/* We got a string back, so run it through the filter */
|
||||
streams = (orte_output_stream_t**)orte_output_streams.addr;
|
||||
filtered = opal_filter.process(output, major_id, minor_id,
|
||||
streams[output_id]->num_tags,
|
||||
streams[output_id]->tags);
|
||||
if (NULL == filtered) {
|
||||
filtered = output;
|
||||
}
|
||||
|
||||
/* Per a soon-to-be-filed trac ticket: because this function calls
|
||||
RML send, recursion is possible in two places:
|
||||
|
||||
@ -408,7 +349,7 @@ static void output_vverbose(int verbose_level, int output_id,
|
||||
OPAL_OUTPUT_VERBOSE((20, orte_debug_output,
|
||||
"%s orte_output recursion detected",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
||||
opal_output(output_id, filtered);
|
||||
opal_output(output_id, output);
|
||||
goto cleanup;
|
||||
}
|
||||
am_inside = true;
|
||||
@ -421,20 +362,22 @@ static void output_vverbose(int verbose_level, int output_id,
|
||||
"%s output to stream %d",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
output_id));
|
||||
opal_output(output_id, filtered);
|
||||
opal_output(output_id, output);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* lookup the flags for this stream */
|
||||
flags = OPAL_VALUE_ARRAY_GET_ITEM(&orte_output_streams, uint8_t, output_id);
|
||||
|
||||
/* If there's other flags besides STDOUT and STDERR set, then also
|
||||
output this locally via opal_output */
|
||||
if ((~(ORTE_OUTPUT_STDOUT | ORTE_OUTPUT_STDERR)) &
|
||||
streams[output_id]->flags) {
|
||||
if ((~(ORTE_OUTPUT_STDOUT | ORTE_OUTPUT_STDERR)) & flags) {
|
||||
OPAL_OUTPUT_VERBOSE((5, orte_debug_output,
|
||||
"%s locally output to stream %d",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
output_id));
|
||||
/* pass the values to opal_output for local handling */
|
||||
opal_output(output_id, filtered);
|
||||
opal_output(output_id, output);
|
||||
}
|
||||
|
||||
/* We only relay stdout/stderr to the HNP. Note that it is
|
||||
@ -443,12 +386,11 @@ static void output_vverbose(int verbose_level, int output_id,
|
||||
relative ordering of output from local calls to opal_output
|
||||
(e.g., for syslog or file, above) as the RML sends to the
|
||||
HNP. */
|
||||
flag = streams[output_id]->flags;
|
||||
if (ORTE_OUTPUT_STDOUT & flag || ORTE_OUTPUT_STDERR & flag) {
|
||||
if (ORTE_OUTPUT_STDOUT & flags || ORTE_OUTPUT_STDERR & flags) {
|
||||
OPAL_OUTPUT_VERBOSE((5, orte_debug_output,
|
||||
"%s sending filtered output \'%s\' from stream %d",
|
||||
"%s sending output \'%s\' from stream %d",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
filtered, output_id));
|
||||
output, output_id));
|
||||
|
||||
/* If RML is not yet setup, or we haven't yet defined the HNP,
|
||||
* then just output this locally.
|
||||
@ -456,14 +398,14 @@ static void output_vverbose(int verbose_level, int output_id,
|
||||
*/
|
||||
if (NULL == orte_rml.send_buffer ||
|
||||
ORTE_PROC_MY_HNP->vpid == ORTE_VPID_INVALID) {
|
||||
opal_output(0, filtered);
|
||||
opal_output(0, output);
|
||||
} else {
|
||||
/* setup a buffer to send to the HNP */
|
||||
OBJ_CONSTRUCT(&buf, opal_buffer_t);
|
||||
/* pack a flag indicating the output channel */
|
||||
opal_dss.pack(&buf, &flag, 1, OPAL_UINT8);
|
||||
opal_dss.pack(&buf, &flags, 1, OPAL_UINT8);
|
||||
/* pack the string */
|
||||
opal_dss.pack(&buf, &filtered, 1, OPAL_STRING);
|
||||
opal_dss.pack(&buf, &output, 1, OPAL_STRING);
|
||||
/* send to the HNP */
|
||||
if (0 > (rc = orte_rml.send_buffer(ORTE_PROC_MY_HNP, &buf,
|
||||
ORTE_RML_TAG_OUTPUT, 0))) {
|
||||
@ -475,9 +417,6 @@ static void output_vverbose(int verbose_level, int output_id,
|
||||
}
|
||||
|
||||
cleanup:
|
||||
if (filtered != output && NULL != filtered) {
|
||||
free(filtered);
|
||||
}
|
||||
if (NULL != output) {
|
||||
free(output);
|
||||
}
|
||||
@ -696,20 +635,21 @@ int orte_output_init(void)
|
||||
/* Show help duplicate detection */
|
||||
OBJ_CONSTRUCT(&abd_tuples, opal_list_t);
|
||||
|
||||
/* setup arrays to track what output streams are
|
||||
* going to stdout and/or stderr, and to track
|
||||
* tags for possible filtering
|
||||
/* setup array to track what output streams are
|
||||
* going to stdout and/or stderr
|
||||
*/
|
||||
OBJ_CONSTRUCT(&orte_output_streams, opal_pointer_array_t);
|
||||
OBJ_CONSTRUCT(&orte_output_streams, opal_value_array_t);
|
||||
opal_value_array_init(&orte_output_streams, sizeof(uint8_t));
|
||||
|
||||
/* reserve places for 50 streams - the array will
|
||||
* resize above that if required
|
||||
*/
|
||||
opal_pointer_array_init(&orte_output_streams, 50, INT_MAX, 10);
|
||||
opal_value_array_reserve(&orte_output_streams, 50);
|
||||
/* initialize the 0 position of the array as this
|
||||
* corresponds to the automatically-opened stderr
|
||||
* stream of opal_output
|
||||
*/
|
||||
new_stream_tracker(0, ORTE_OUTPUT_STDERR, "STDERR", NULL);
|
||||
OPAL_VALUE_ARRAY_SET_ITEM(&orte_output_streams, uint8_t, 0, ORTE_OUTPUT_STDERR);
|
||||
|
||||
/* if we are on the HNP, we need to open
|
||||
* dedicated orte_output streams for stdout/stderr
|
||||
@ -724,7 +664,7 @@ int orte_output_init(void)
|
||||
/* deliver to stdout only */
|
||||
stdout_lds.lds_want_stdout = true;
|
||||
stdout_stream = opal_output_open(&stdout_lds);
|
||||
new_stream_tracker(stdout_stream, ORTE_OUTPUT_STDOUT, "STDOUT", NULL);
|
||||
OPAL_VALUE_ARRAY_SET_ITEM(&orte_output_streams, uint8_t, stdout_stream, ORTE_OUTPUT_STDOUT);
|
||||
/* setup stderr stream - we construct our own
|
||||
* stream object so we can control the behavior
|
||||
*/
|
||||
@ -734,7 +674,7 @@ int orte_output_init(void)
|
||||
/* we filter the stderr */
|
||||
stderr_lds.lds_filter_flags = OPAL_OUTPUT_FILTER_STDERR;
|
||||
stderr_stream = opal_output_open(&stderr_lds);
|
||||
new_stream_tracker(stderr_stream, ORTE_OUTPUT_STDERR, "STDERR", NULL);
|
||||
OPAL_VALUE_ARRAY_SET_ITEM(&orte_output_streams, uint8_t, stderr_stream, ORTE_OUTPUT_STDERR);
|
||||
}
|
||||
|
||||
orte_output_ready = true;
|
||||
@ -743,9 +683,6 @@ int orte_output_init(void)
|
||||
|
||||
void orte_output_finalize(void)
|
||||
{
|
||||
int i;
|
||||
orte_output_stream_t **streams;
|
||||
|
||||
if (!orte_output_ready) {
|
||||
return;
|
||||
}
|
||||
@ -781,12 +718,6 @@ void orte_output_finalize(void)
|
||||
* will be called after we close orte_output, and we
|
||||
* need to retain an ability to get those messages out.
|
||||
*/
|
||||
streams = (orte_output_stream_t**)orte_output_streams.addr;
|
||||
for (i=0; i < orte_output_streams.size; i++) {
|
||||
if (NULL != streams[i]) {
|
||||
OBJ_RELEASE(streams[i]);
|
||||
}
|
||||
}
|
||||
OBJ_DESTRUCT(&orte_output_streams);
|
||||
}
|
||||
|
||||
@ -814,17 +745,15 @@ void orte_output_finalize(void)
|
||||
* and do nothing else
|
||||
*/
|
||||
|
||||
int orte_output_open(opal_output_stream_t *lds, const char *primary_tag, ...)
|
||||
int orte_output_open(opal_output_stream_t *lds)
|
||||
{
|
||||
int stream;
|
||||
uint8_t flag = ORTE_OUTPUT_OTHER;
|
||||
va_list arglist;
|
||||
|
||||
if (!orte_output_ready) {
|
||||
/* see above discussion on how we handle this error */
|
||||
fprintf(stderr, "A call was made to orte_output_open %s with primary tag %s\n",
|
||||
orte_finalizing ? "during or after calling orte_finalize" : "prior to calling orte_init",
|
||||
primary_tag);
|
||||
fprintf(stderr, "A call was made to orte_output_open %s\n",
|
||||
orte_finalizing ? "during or after calling orte_finalize" : "prior to calling orte_init");
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
|
||||
@ -871,10 +800,8 @@ int orte_output_open(opal_output_stream_t *lds, const char *primary_tag, ...)
|
||||
stream));
|
||||
|
||||
track:
|
||||
/* track the settings */
|
||||
va_start(arglist, primary_tag);
|
||||
new_stream_tracker(stream, flag, primary_tag, arglist);
|
||||
va_end(arglist);
|
||||
/* track the settings - can't use macro as this may adjust size of array */
|
||||
opal_value_array_set_item(&orte_output_streams, stream, (void*)&flag);
|
||||
|
||||
return stream;
|
||||
}
|
||||
@ -950,9 +877,7 @@ void orte_output_verbose(int verbose_level, int output_id, const char *format, .
|
||||
}
|
||||
|
||||
void orte_output_close(int output_id)
|
||||
{
|
||||
orte_output_stream_t **streams;
|
||||
|
||||
{
|
||||
if (!orte_output_ready && !orte_finalizing) {
|
||||
/* if we are finalizing, then we really don't want
|
||||
* to init this system - otherwise, this was called prior
|
||||
@ -964,10 +889,7 @@ void orte_output_close(int output_id)
|
||||
}
|
||||
|
||||
/* cleanout the stream settings */
|
||||
streams = (orte_output_stream_t**)orte_output_streams.addr;
|
||||
if (output_id >= 0 && NULL != streams[output_id]) {
|
||||
OBJ_RELEASE(streams[output_id]);
|
||||
}
|
||||
OPAL_VALUE_ARRAY_SET_ITEM(&orte_output_streams, uint8_t, output_id, ORTE_OUTPUT_OTHER);
|
||||
opal_output_close(output_id);
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ ORTE_DECLSPEC void orte_output_finalize(void);
|
||||
* through the various streams
|
||||
*
|
||||
*/
|
||||
ORTE_DECLSPEC int orte_output_open(opal_output_stream_t *lds, const char *primary_tag, ...);
|
||||
ORTE_DECLSPEC int orte_output_open(opal_output_stream_t *lds);
|
||||
|
||||
/**
|
||||
* Re-opens / redirects an output stream.
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user