Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions opal/datatype/opal_datatype_get_count.c
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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" );
Expand Down Expand Up @@ -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" );
Expand Down Expand Up @@ -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" );
Expand All @@ -194,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 */
}
}
Expand Down
9 changes: 4 additions & 5 deletions opal/datatype/opal_datatype_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 )
Expand Down
20 changes: 18 additions & 2 deletions opal/datatype/opal_datatype_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -29,6 +29,7 @@
#include <stddef.h>

#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"
Expand All @@ -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;

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}

Expand Down