From 428a38a29ae1c0636fcb96a4e43695021483a526 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Thu, 24 Mar 2005 20:23:15 +0000 Subject: [PATCH] Update logic for debug streams This commit was SVN r5016. --- src/mca/errmgr/base/errmgr_base_open.c | 18 +++++++++---- src/mca/gpr/base/gpr_base_open.c | 35 +++++++++++++++----------- src/mca/ns/base/ns_base_open.c | 34 ++++++++++++++----------- 3 files changed, 53 insertions(+), 34 deletions(-) diff --git a/src/mca/errmgr/base/errmgr_base_open.c b/src/mca/errmgr/base/errmgr_base_open.c index 94c3823f51..b7e7599630 100644 --- a/src/mca/errmgr/base/errmgr_base_open.c +++ b/src/mca/errmgr/base/errmgr_base_open.c @@ -61,8 +61,21 @@ bool orte_errmgr_initialized = false; */ int orte_errmgr_base_open(void) { + int param, value; + if (!orte_errmgr_initialized) { /* ensure we only do this once */ + /* Debugging / verbose output */ + + param = mca_base_param_register_int("errmgr", "base", "verbose", + NULL, 0); + mca_base_param_lookup_int(param, &value); + if (value != 0) { + orte_errmgr_base_output = ompi_output_open(NULL); + } else { + orte_errmgr_base_output = -1; + } + /* Open up all available components */ if (ORTE_SUCCESS != @@ -71,11 +84,6 @@ int orte_errmgr_base_open(void) return ORTE_ERROR; } - /* setup output for debug messages */ - if (!ompi_output_init) { /* can't open output */ - return ORTE_ERROR; - } - if (0 > orte_errmgr_base_output) orte_errmgr_base_output = ompi_output_open(NULL); diff --git a/src/mca/gpr/base/gpr_base_open.c b/src/mca/gpr/base/gpr_base_open.c index 9828014869..cd67bc4ed7 100644 --- a/src/mca/gpr/base/gpr_base_open.c +++ b/src/mca/gpr/base/gpr_base_open.c @@ -282,23 +282,28 @@ ompi_mutex_t orte_gpr_mutex; */ int orte_gpr_base_open(void) { + int param, value; - /* Open up all available components */ + /* Debugging / verbose output */ + + param = mca_base_param_register_int("gpr", "base", "verbose", + NULL, 0); + mca_base_param_lookup_int(param, &value); + if (value != 0) { + orte_gpr_base_output = ompi_output_open(NULL); + } else { + orte_gpr_base_output = -1; + } - if (OMPI_SUCCESS != - mca_base_components_open("gpr", 0, mca_gpr_base_static_components, - &orte_gpr_base_components_available)) { - return ORTE_ERROR; - } + /* Open up all available components */ - /* setup output for debug messages */ - if (!ompi_output_init) { /* can't open output */ - return ORTE_ERROR; - } + if (OMPI_SUCCESS != + mca_base_components_open("gpr", 0, mca_gpr_base_static_components, + &orte_gpr_base_components_available)) { + return ORTE_ERROR; + } - orte_gpr_base_output = ompi_output_open(NULL); - - /* All done */ - - return ORTE_SUCCESS; + /* All done */ + + return ORTE_SUCCESS; } diff --git a/src/mca/ns/base/ns_base_open.c b/src/mca/ns/base/ns_base_open.c index 8f3ec510a4..871f4511b1 100644 --- a/src/mca/ns/base/ns_base_open.c +++ b/src/mca/ns/base/ns_base_open.c @@ -107,22 +107,28 @@ OBJ_CLASS_INSTANCE( */ int orte_ns_base_open(void) { - /* Open up all available components */ + int param, value; - if (ORTE_SUCCESS != - mca_base_components_open("ns", 0, mca_ns_base_static_components, - &mca_ns_base_components_available)) { - return ORTE_ERROR; - } + /* Debugging / verbose output */ + + param = mca_base_param_register_int("ns", "base", "verbose", + NULL, 0); + mca_base_param_lookup_int(param, &value); + if (value != 0) { + mca_ns_base_output = ompi_output_open(NULL); + } else { + mca_ns_base_output = -1; + } - /* setup output for debug messages */ - if (!ompi_output_init) { /* can't open output */ - return ORTE_ERROR; - } + /* Open up all available components */ + + if (ORTE_SUCCESS != + mca_base_components_open("ns", 0, mca_ns_base_static_components, + &mca_ns_base_components_available)) { + return ORTE_ERROR; + } - mca_ns_base_output = ompi_output_open(NULL); + /* All done */ - /* All done */ - - return ORTE_SUCCESS; + return ORTE_SUCCESS; }