From 4cc737c755aafb74455bad00d5fc507904dc6f03 Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Thu, 8 Mar 2018 03:13:30 +0900 Subject: [PATCH 1/3] Update the loop stats. The loop should be updated on each internal iteration. Signed-off-by: George Bosilca (cherry picked from commit 78480351955b8a27d44221090736df1716f3c384) --- opal/datatype/opal_datatype_get_count.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/opal/datatype/opal_datatype_get_count.c b/opal/datatype/opal_datatype_get_count.c index 9f1b0ecf8e5..ab2d69a8f35 100644 --- a/opal/datatype/opal_datatype_get_count.c +++ b/opal/datatype/opal_datatype_get_count.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; -*- */ /* - * Copyright (c) 2004-2017 The University of Tennessee and The University + * Copyright (c) 2004-2018 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. @@ -60,9 +60,8 @@ ssize_t opal_datatype_get_element_count( const opal_datatype_t* datatype, size_t continue; } if( OPAL_DATATYPE_LOOP == pElems[pos_desc].elem.common.type ) { - ddt_loop_desc_t* loop = &(pElems[pos_desc].loop); do { - PUSH_STACK( pStack, stack_pos, pos_desc, OPAL_DATATYPE_LOOP, loop->loops, 0 ); + PUSH_STACK( pStack, stack_pos, pos_desc, OPAL_DATATYPE_LOOP, pElems[pos_desc].loop.loops, 0 ); pos_desc++; } while( OPAL_DATATYPE_LOOP == pElems[pos_desc].elem.common.type ); /* let's start another loop */ DDT_DUMP_STACK( pStack, stack_pos, pElems, "advance loops" ); @@ -123,9 +122,8 @@ int32_t opal_datatype_set_element_count( const opal_datatype_t* datatype, size_t continue; } if( OPAL_DATATYPE_LOOP == pElems[pos_desc].elem.common.type ) { - ddt_loop_desc_t* loop = &(pElems[pos_desc].loop); do { - PUSH_STACK( pStack, stack_pos, pos_desc, OPAL_DATATYPE_LOOP, loop->loops, 0 ); + PUSH_STACK( pStack, stack_pos, pos_desc, OPAL_DATATYPE_LOOP, pElems[pos_desc].loop.loops, 0 ); pos_desc++; } while( OPAL_DATATYPE_LOOP == pElems[pos_desc].elem.common.type ); /* let's start another loop */ DDT_DUMP_STACK( pStack, stack_pos, pElems, "advance loops" ); @@ -182,9 +180,8 @@ int opal_datatype_compute_ptypes( opal_datatype_t* datatype ) continue; } if( OPAL_DATATYPE_LOOP == pElems[pos_desc].elem.common.type ) { - ddt_loop_desc_t* loop = &(pElems[pos_desc].loop); do { - PUSH_STACK( pStack, stack_pos, pos_desc, OPAL_DATATYPE_LOOP, loop->loops, 0 ); + PUSH_STACK( pStack, stack_pos, pos_desc, OPAL_DATATYPE_LOOP, pElems[pos_desc].loop.loops, 0 ); pos_desc++; } while( OPAL_DATATYPE_LOOP == pElems[pos_desc].elem.common.type ); /* let's start another loop */ DDT_DUMP_STACK( pStack, stack_pos, pElems, "advance loops" ); From 36f6b1b47fd3b3e4838f2879108a37fd94dfba0b Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Thu, 8 Mar 2018 03:14:36 +0900 Subject: [PATCH 2/3] Fix the datatype debug. Signed-off-by: George Bosilca (cherry picked from commit 999de137ce66077cefedd43a2cba7a42a99f873f) --- opal/datatype/opal_datatype_get_count.c | 3 +++ opal/datatype/opal_datatype_internal.h | 9 ++++----- opal/datatype/opal_datatype_module.c | 20 ++++++++++++++++++-- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/opal/datatype/opal_datatype_get_count.c b/opal/datatype/opal_datatype_get_count.c index ab2d69a8f35..ae085c42704 100644 --- a/opal/datatype/opal_datatype_get_count.c +++ b/opal/datatype/opal_datatype_get_count.c @@ -191,6 +191,9 @@ int opal_datatype_compute_ptypes( opal_datatype_t* datatype ) datatype->ptypes[pElems[pos_desc].elem.common.type] += pElems[pos_desc].elem.count; nbElems += pElems[pos_desc].elem.count; + DUMP( " compute_ptypes-add: type %d count %"PRIsize_t" (total type %"PRIsize_t" total %lld)\n", + pElems[pos_desc].elem.common.type, datatype->ptypes[pElems[pos_desc].elem.common.type], + pElems[pos_desc].elem.count, nbElems ); pos_desc++; /* advance to the next data */ } } diff --git a/opal/datatype/opal_datatype_internal.h b/opal/datatype/opal_datatype_internal.h index 9ff34921495..bc3f8aa7cab 100644 --- a/opal/datatype/opal_datatype_internal.h +++ b/opal/datatype/opal_datatype_internal.h @@ -3,7 +3,7 @@ * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2017 The University of Tennessee and The University + * Copyright (c) 2004-2018 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2006 High Performance Computing Center Stuttgart, @@ -49,10 +49,9 @@ static inline void DUMP( char* fmt, ... ) va_list list; va_start( list, fmt ); - opal_output( opal_datatype_dfd, fmt, list ); + opal_output_vverbose( 0, opal_datatype_dfd, fmt, list ); va_end( list ); } -# define DUMP printf # endif /* __GNUC__ && !__STDC__ */ # endif /* ACCEPT_C99 */ #else @@ -329,8 +328,8 @@ struct opal_datatype_t; .ptypes = OPAL_DATATYPE_INIT_PTYPES_ARRAY_UNAVAILABLE \ } -#define OPAL_DATATYPE_INITIALIZER_LOOP(FLAGS) OPAL_DATATYPE_INIT_BASIC_TYPE( OPAL_DATATYPE_LOOP, LOOP, FLAGS ) -#define OPAL_DATATYPE_INITIALIZER_END_LOOP(FLAGS) OPAL_DATATYPE_INIT_BASIC_TYPE( OPAL_DATATYPE_END_LOOP, END_LOOP, FLAGS ) +#define OPAL_DATATYPE_INITIALIZER_LOOP(FLAGS) OPAL_DATATYPE_INIT_BASIC_TYPE( OPAL_DATATYPE_LOOP, LOOP_S, FLAGS ) +#define OPAL_DATATYPE_INITIALIZER_END_LOOP(FLAGS) OPAL_DATATYPE_INIT_BASIC_TYPE( OPAL_DATATYPE_END_LOOP, LOOP_E, FLAGS ) #define OPAL_DATATYPE_INITIALIZER_LB(FLAGS) OPAL_DATATYPE_INIT_BASIC_TYPE( OPAL_DATATYPE_LB, LB, FLAGS ) #define OPAL_DATATYPE_INITIALIZER_UB(FLAGS) OPAL_DATATYPE_INIT_BASIC_TYPE( OPAL_DATATYPE_UB, UB, FLAGS ) #define OPAL_DATATYPE_INITIALIZER_INT1(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( int8_t, OPAL_ALIGNMENT_INT8, INT1, FLAGS ) diff --git a/opal/datatype/opal_datatype_module.c b/opal/datatype/opal_datatype_module.c index 7de8fae5b08..7b4f33e8684 100644 --- a/opal/datatype/opal_datatype_module.c +++ b/opal/datatype/opal_datatype_module.c @@ -3,7 +3,7 @@ * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2013 The University of Tennessee and The University + * Copyright (c) 2004-2018 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2006 High Performance Computing Center Stuttgart, @@ -29,6 +29,7 @@ #include #include "opal/util/arch.h" +#include "opal/util/output.h" #include "opal/datatype/opal_datatype_internal.h" #include "opal/datatype/opal_datatype.h" #include "opal/datatype/opal_convertor_internal.h" @@ -40,6 +41,7 @@ bool opal_unpack_debug = false; bool opal_pack_debug = false; bool opal_position_debug = false; bool opal_copy_debug = false; +int opal_ddt_verbose = -1; /* Has the datatype verbose it's own output stream */ extern int opal_cuda_verbose; @@ -177,11 +179,19 @@ int opal_datatype_register_params(void) return ret; } + ret = mca_base_var_register ("opal", "opal", NULL, "ddt_verbose", + "Set level of opal datatype verbosity", + MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE, + OPAL_INFO_LVL_8, MCA_BASE_VAR_SCOPE_LOCAL, + &opal_ddt_verbose); + if (0 > ret) { + return ret; + } #if OPAL_CUDA_SUPPORT /* Set different levels of verbosity in the cuda related code. */ ret = mca_base_var_register ("opal", "opal", NULL, "cuda_verbose", "Set level of opal cuda verbosity", - MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE, + MCA_BASE_VAR_TYPE_INT, NULL, -1, MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_8, MCA_BASE_VAR_SCOPE_LOCAL, &opal_cuda_verbose); if (0 > ret) { @@ -226,6 +236,12 @@ int32_t opal_datatype_init( void ) datatype->desc.desc[1].end_loop.size = datatype->size; } + /* Enable a private output stream for datatype */ + if( opal_ddt_verbose > 0 ) { + opal_datatype_dfd = opal_output_open(NULL); + opal_output_set_verbosity(opal_datatype_dfd, opal_ddt_verbose); + } + return OPAL_SUCCESS; } From 92eab88f5cc2b024cdb3334216e04d35620952d3 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Tue, 13 Mar 2018 10:10:15 -0700 Subject: [PATCH 3/3] opal_datatype_module.c: reset opal_cuda_verbose 999de137ce6 accidentally reset opal_cuda_verbose's default value. This commit puts it back. Signed-off-by: Jeff Squyres (cherry picked from commit 2713a2400984aa7ed1e35fc282b9899840f06e15) --- opal/datatype/opal_datatype_module.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opal/datatype/opal_datatype_module.c b/opal/datatype/opal_datatype_module.c index 7b4f33e8684..2d8dedc94e7 100644 --- a/opal/datatype/opal_datatype_module.c +++ b/opal/datatype/opal_datatype_module.c @@ -10,7 +10,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2006 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2007-2018 Cisco Systems, Inc. All rights reserved * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2013 Los Alamos National Security, LLC. All rights @@ -191,7 +191,7 @@ int opal_datatype_register_params(void) /* Set different levels of verbosity in the cuda related code. */ ret = mca_base_var_register ("opal", "opal", NULL, "cuda_verbose", "Set level of opal cuda verbosity", - MCA_BASE_VAR_TYPE_INT, NULL, -1, MCA_BASE_VAR_FLAG_SETTABLE, + MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_8, MCA_BASE_VAR_SCOPE_LOCAL, &opal_cuda_verbose); if (0 > ret) {