From 3dd5196338cc42f8c6fe7ff06adaa0bb3a7570ca Mon Sep 17 00:00:00 2001 From: Rolf vandeVaart Date: Mon, 15 Oct 2007 13:10:20 +0000 Subject: [PATCH] Remove the --mca btl_base_debug flag and clean up the use of the --mca btl_base_verbose flag. The btl framework now matches all the other frameworks. Slightly modify error messages for clarity. This commit was SVN r16443. --- ompi/mca/btl/base/btl_base_error.c | 4 ++-- ompi/mca/btl/base/btl_base_error.h | 21 +++++---------------- ompi/mca/btl/base/btl_base_open.c | 25 +++++++++++-------------- ompi/mca/btl/base/btl_base_select.c | 10 +++++++--- ompi/mca/btl/tcp/btl_tcp_endpoint.c | 3 ++- 5 files changed, 27 insertions(+), 36 deletions(-) diff --git a/ompi/mca/btl/base/btl_base_error.c b/ompi/mca/btl/base/btl_base_error.c index ed78ecc596..2caac992e6 100644 --- a/ompi/mca/btl/base/btl_base_error.c +++ b/ompi/mca/btl/base/btl_base_error.c @@ -9,7 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2006-2007 Sun Microsystems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,7 +28,7 @@ #include "orte/util/sys_info.h" #include "orte/mca/ns/ns_types.h" -int mca_btl_base_debug; +int mca_btl_base_verbose; int mca_btl_base_err(const char* fmt, ...) { diff --git a/ompi/mca/btl/base/btl_base_error.h b/ompi/mca/btl/base/btl_base_error.h index 35108c9481..87d22c2172 100644 --- a/ompi/mca/btl/base/btl_base_error.h +++ b/ompi/mca/btl/base/btl_base_error.h @@ -10,6 +10,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -29,7 +30,7 @@ #include "orte/util/sys_info.h" #include "orte/mca/ns/ns_types.h" -OMPI_DECLSPEC extern int mca_btl_base_debug; +OMPI_DECLSPEC extern int mca_btl_base_verbose; OMPI_DECLSPEC extern int mca_btl_base_err(const char*, ...); extern int mca_btl_base_out(const char*, ...); @@ -70,30 +71,18 @@ do { \ #if OMPI_ENABLE_DEBUG -#define BTL_DEBUG(args) \ -do { \ - if(mca_btl_base_debug) { \ - mca_btl_base_err("[%s]%s[%s:%d:%s] ", \ - orte_system_info.nodename, \ - ORTE_NAME_PRINT(orte_process_info.my_name), \ - __FILE__, __LINE__, __func__); \ - mca_btl_base_err args; \ - mca_btl_base_err("\n"); \ - } \ -} while(0); #define BTL_VERBOSE(args) \ do { \ - if(mca_btl_base_debug > 1) { \ - mca_btl_base_err("[%s]%s[%s:%d:%s] ", \ + if(mca_btl_base_verbose > 0) { \ + mca_btl_base_err("[%s]%s[%s:%d:%s] ", \ orte_system_info.nodename, \ - ORTE_NAME_PRINT(orte_process_info.my_name), \ + ORTE_NAME_PRINT(orte_process_info.my_name), \ __FILE__, __LINE__, __func__); \ mca_btl_base_err args; \ mca_btl_base_err("\n"); \ } \ } while(0); #else -#define BTL_DEBUG(args) #define BTL_VERBOSE(args) #endif diff --git a/ompi/mca/btl/base/btl_base_open.c b/ompi/mca/btl/base/btl_base_open.c index 21532ab086..7ed6b4f846 100644 --- a/ompi/mca/btl/base/btl_base_open.c +++ b/ompi/mca/btl/base/btl_base_open.c @@ -9,7 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2006-2007 Sun Microsystems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -84,24 +84,21 @@ int mca_btl_base_open(void) { if( ++already_opened > 1 ) return OMPI_SUCCESS; - mca_base_param_reg_int_name( "btl", - "base_debug", - "If btl_base_debug is 1 standard debug is output, if > 1 verbose debug is output", - false, false, - 0, - &mca_btl_base_debug ); + /* Verbose output */ + mca_base_param_reg_int_name("btl", + "base_verbose", + "Verbosity level of the BTL framework", + false, false, + 0, + &mca_btl_base_verbose); - if( mca_btl_base_debug > 0 ) { - mca_btl_base_output = opal_output_open(NULL); - opal_output_set_verbosity(mca_btl_base_output, mca_btl_base_debug); - } else { - mca_btl_base_output = -1; - } + mca_btl_base_output = opal_output_open(NULL); + opal_output_set_verbosity(mca_btl_base_output, mca_btl_base_verbose); /* Open up all available components */ if (OMPI_SUCCESS != - mca_base_components_open("btl", 0, mca_btl_base_static_components, + mca_base_components_open("btl", mca_btl_base_output, mca_btl_base_static_components, &mca_btl_base_components_opened, true)) { return OMPI_ERROR; } diff --git a/ompi/mca/btl/base/btl_base_select.c b/ompi/mca/btl/base/btl_base_select.c index bc5d0ceee8..a8c1378608 100644 --- a/ompi/mca/btl/base/btl_base_select.c +++ b/ompi/mca/btl/base/btl_base_select.c @@ -9,6 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. + * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -104,7 +105,8 @@ int mca_btl_base_select(bool enable_progress_threads, component->btl_version.mca_component_name); if (NULL == component->btl_init) { opal_output_verbose(10, mca_btl_base_output, - "select: no init function; ignoring component"); + "select: no init function; ignoring component %s", + component->btl_version.mca_component_name); } else { modules = component->btl_init(&num_btls, enable_progress_threads, enable_mpi_threads); @@ -114,7 +116,8 @@ int mca_btl_base_select(bool enable_progress_threads, if (NULL == modules) { opal_output_verbose(10, mca_btl_base_output, - "select: init returned failure"); + "select: init of component %s returned failure", + component->btl_version.mca_component_name); opal_output_verbose(10, mca_btl_base_output, "select: module %s unloaded", component->btl_version.mca_component_name); @@ -127,7 +130,8 @@ int mca_btl_base_select(bool enable_progress_threads, else { opal_output_verbose(10, mca_btl_base_output, - "select: init returned success"); + "select: init of component %s returned success", + component->btl_version.mca_component_name); for (i = 0; i < num_btls; ++i) { sm = OBJ_NEW(mca_btl_base_selected_module_t); diff --git a/ompi/mca/btl/tcp/btl_tcp_endpoint.c b/ompi/mca/btl/tcp/btl_tcp_endpoint.c index 386d592a87..8e21114578 100644 --- a/ompi/mca/btl/tcp/btl_tcp_endpoint.c +++ b/ompi/mca/btl/tcp/btl_tcp_endpoint.c @@ -9,6 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. + * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -194,7 +195,7 @@ static void mca_btl_tcp_endpoint_dump(mca_btl_base_endpoint_t* btl_endpoint, con nodelay = 0; #endif - BTL_DEBUG(("%s: %s - %s nodelay %d sndbuf %d rcvbuf %d flags %08x", + BTL_VERBOSE(("%s: %s - %s nodelay %d sndbuf %d rcvbuf %d flags %08x", msg, src, dst, nodelay, sndbuf, rcvbuf, flags)); } #endif