Can you add this to NEWS, please?

Thanks.



On Mar 8, 2012, at 5:02 PM, jjhur...@osl.iu.edu wrote:

> Author: jjhursey
> Date: 2012-03-08 17:02:28 EST (Thu, 08 Mar 2012)
> New Revision: 26119
> URL: https://svn.open-mpi.org/trac/ompi/changeset/26119
> 
> Log:
> Create an MCA parameter (ess_base_stream_buffering) that allows the user to 
> override the system default for buffering of stdout/stderr streams. See 'man 
> setvbuf' for more information.
> 
> Note: I am working on a system that buffered all output until the application 
> fishished due to a default of 'fully buffered.' This makes debugging painful. 
> This switch fixed the problem by allowing me to adjust the buffering.
> 
> 
> Text files modified: 
>   trunk/orte/mca/ess/base/base.h             |     6 ++++++                   
>                
>   trunk/orte/mca/ess/base/ess_base_open.c    |    10 ++++++++++               
>                
>   trunk/orte/mca/ess/base/ess_base_std_app.c |    22 +++++++++++++++++++++-   
>                
>   3 files changed, 37 insertions(+), 1 deletions(-)
> 
> Modified: trunk/orte/mca/ess/base/base.h
> ==============================================================================
> --- trunk/orte/mca/ess/base/base.h    (original)
> +++ trunk/orte/mca/ess/base/base.h    2012-03-08 17:02:28 EST (Thu, 08 Mar 
> 2012)
> @@ -10,6 +10,7 @@
>  * Copyright (c) 2004-2005 The Regents of the University of California.
>  *                         All rights reserved.
>  * Copyright (c) 2011      Cisco Systems, Inc.  All rights reserved.
> + * Copyright (c) 2012      Oak Ridge National Labs.  All rights reserved.
>  * $COPYRIGHT$
>  * 
>  * Additional copyrights may follow
> @@ -56,6 +57,11 @@
>  */
> ORTE_DECLSPEC extern int orte_ess_base_output;
> 
> +/*
> + * stdout/stderr buffering control parameter
> + */
> +ORTE_DECLSPEC extern int orte_ess_base_std_buffering;
> +
> ORTE_DECLSPEC extern opal_list_t orte_ess_base_components_available;
> 
> #if ORTE_ENABLE_EPOCH
> 
> Modified: trunk/orte/mca/ess/base/ess_base_open.c
> ==============================================================================
> --- trunk/orte/mca/ess/base/ess_base_open.c   (original)
> +++ trunk/orte/mca/ess/base/ess_base_open.c   2012-03-08 17:02:28 EST (Thu, 
> 08 Mar 2012)
> @@ -10,6 +10,7 @@
>  * Copyright (c) 2004-2005 The Regents of the University of California.
>  *                         All rights reserved.
>  * Copyright (c) 2011 Cisco Systems, Inc.  All rights reserved.
> + * Copyright (c) 2012      Oak Ridge National Labs.  All rights reserved.
>  * $COPYRIGHT$
>  * 
>  * Additional copyrights may follow
> @@ -51,10 +52,19 @@
>     NULL   /* ft_event */
> };
> int orte_ess_base_output;
> +int orte_ess_base_std_buffering = -1;
> 
> int
> orte_ess_base_open(void)
> {
> +    mca_base_param_reg_int_name("ess_base",
> +                                "stream_buffering",
> +                                "Adjust buffering for stdout/stderr "
> +                                "[-1 system default] [0 unbuffered] [1 line 
> buffered] [2 fully buffered] "
> +                                "(Default: -1)",
> +                                false, false,
> +                                -1, &orte_ess_base_std_buffering);
> +
>     orte_ess_base_output = opal_output_open(NULL);
> 
>     OBJ_CONSTRUCT(&orte_ess_base_components_available, opal_list_t);
> 
> Modified: trunk/orte/mca/ess/base/ess_base_std_app.c
> ==============================================================================
> --- trunk/orte/mca/ess/base/ess_base_std_app.c        (original)
> +++ trunk/orte/mca/ess/base/ess_base_std_app.c        2012-03-08 17:02:28 EST 
> (Thu, 08 Mar 2012)
> @@ -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) 2010-2011 Oak Ridge National Labs.  All rights reserved.
> + * Copyright (c) 2010-2012 Oak Ridge National Labs.  All rights reserved.
>  * $COPYRIGHT$
>  * 
>  * Additional copyrights may follow
> @@ -65,6 +65,26 @@
>     int ret;
>     char *error = NULL;
> 
> +    /*
> +     * stdout/stderr buffering
> +     * If the user requested to override the default setting then do
> +     * as they wish.
> +     */
> +    if( orte_ess_base_std_buffering > -1 ) {
> +        if( 0 == orte_ess_base_std_buffering ) {
> +            setvbuf(stdout, NULL, _IONBF, 0);
> +            setvbuf(stderr, NULL, _IONBF, 0);
> +        }
> +        else if( 1 == orte_ess_base_std_buffering ) {
> +            setvbuf(stdout, NULL, _IOLBF, 0);
> +            setvbuf(stderr, NULL, _IOLBF, 0);
> +        }
> +        else if( 2 == orte_ess_base_std_buffering ) {
> +            setvbuf(stdout, NULL, _IOFBF, 0);
> +            setvbuf(stderr, NULL, _IOFBF, 0);
> +        }
> +    }
> +
>     /* open the errmgr */
>     if (ORTE_SUCCESS != (ret = orte_errmgr_base_open())) {
>         ORTE_ERROR_LOG(ret);
> _______________________________________________
> svn-full mailing list
> svn-f...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/svn-full


-- 
Jeff Squyres
jsquy...@cisco.com
For corporate legal information go to: 
http://www.cisco.com/web/about/doing_business/legal/cri/


Reply via email to