Skip to content

Commit bd91e8b

Browse files
bosilcajsquyres
authored andcommitted
Fix the datatype debug.
Signed-off-by: George Bosilca <[email protected]> (cherry picked from commit 999de13)
1 parent 11f1e8a commit bd91e8b

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

opal/datatype/opal_datatype_get_count.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ int opal_datatype_compute_ptypes( opal_datatype_t* datatype )
191191
datatype->ptypes[pElems[pos_desc].elem.common.type] += pElems[pos_desc].elem.count;
192192
nbElems += pElems[pos_desc].elem.count;
193193

194+
DUMP( " compute_ptypes-add: type %d count %"PRIsize_t" (total type %"PRIsize_t" total %lld)\n",
195+
pElems[pos_desc].elem.common.type, datatype->ptypes[pElems[pos_desc].elem.common.type],
196+
pElems[pos_desc].elem.count, nbElems );
194197
pos_desc++; /* advance to the next data */
195198
}
196199
}

opal/datatype/opal_datatype_internal.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
44
* University Research and Technology
55
* Corporation. All rights reserved.
6-
* Copyright (c) 2004-2017 The University of Tennessee and The University
6+
* Copyright (c) 2004-2018 The University of Tennessee and The University
77
* of Tennessee Research Foundation. All rights
88
* reserved.
99
* Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
@@ -49,10 +49,9 @@ static inline void DUMP( char* fmt, ... )
4949
va_list list;
5050

5151
va_start( list, fmt );
52-
opal_output( opal_datatype_dfd, fmt, list );
52+
opal_output_vverbose( 0, opal_datatype_dfd, fmt, list );
5353
va_end( list );
5454
}
55-
# define DUMP printf
5655
# endif /* __GNUC__ && !__STDC__ */
5756
# endif /* ACCEPT_C99 */
5857
#else
@@ -329,8 +328,8 @@ struct opal_datatype_t;
329328
.ptypes = OPAL_DATATYPE_INIT_PTYPES_ARRAY_UNAVAILABLE \
330329
}
331330

332-
#define OPAL_DATATYPE_INITIALIZER_LOOP(FLAGS) OPAL_DATATYPE_INIT_BASIC_TYPE( OPAL_DATATYPE_LOOP, LOOP, FLAGS )
333-
#define OPAL_DATATYPE_INITIALIZER_END_LOOP(FLAGS) OPAL_DATATYPE_INIT_BASIC_TYPE( OPAL_DATATYPE_END_LOOP, END_LOOP, FLAGS )
331+
#define OPAL_DATATYPE_INITIALIZER_LOOP(FLAGS) OPAL_DATATYPE_INIT_BASIC_TYPE( OPAL_DATATYPE_LOOP, LOOP_S, FLAGS )
332+
#define OPAL_DATATYPE_INITIALIZER_END_LOOP(FLAGS) OPAL_DATATYPE_INIT_BASIC_TYPE( OPAL_DATATYPE_END_LOOP, LOOP_E, FLAGS )
334333
#define OPAL_DATATYPE_INITIALIZER_LB(FLAGS) OPAL_DATATYPE_INIT_BASIC_TYPE( OPAL_DATATYPE_LB, LB, FLAGS )
335334
#define OPAL_DATATYPE_INITIALIZER_UB(FLAGS) OPAL_DATATYPE_INIT_BASIC_TYPE( OPAL_DATATYPE_UB, UB, FLAGS )
336335
#define OPAL_DATATYPE_INITIALIZER_INT1(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( int8_t, OPAL_ALIGNMENT_INT8, INT1, FLAGS )

opal/datatype/opal_datatype_module.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
44
* University Research and Technology
55
* Corporation. All rights reserved.
6-
* Copyright (c) 2004-2013 The University of Tennessee and The University
6+
* Copyright (c) 2004-2018 The University of Tennessee and The University
77
* of Tennessee Research Foundation. All rights
88
* reserved.
99
* Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
@@ -29,6 +29,7 @@
2929
#include <stddef.h>
3030

3131
#include "opal/util/arch.h"
32+
#include "opal/util/output.h"
3233
#include "opal/datatype/opal_datatype_internal.h"
3334
#include "opal/datatype/opal_datatype.h"
3435
#include "opal/datatype/opal_convertor_internal.h"
@@ -40,6 +41,7 @@ bool opal_unpack_debug = false;
4041
bool opal_pack_debug = false;
4142
bool opal_position_debug = false;
4243
bool opal_copy_debug = false;
44+
int opal_ddt_verbose = -1; /* Has the datatype verbose it's own output stream */
4345

4446
extern int opal_cuda_verbose;
4547

@@ -177,11 +179,19 @@ int opal_datatype_register_params(void)
177179
return ret;
178180
}
179181

182+
ret = mca_base_var_register ("opal", "opal", NULL, "ddt_verbose",
183+
"Set level of opal datatype verbosity",
184+
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
185+
OPAL_INFO_LVL_8, MCA_BASE_VAR_SCOPE_LOCAL,
186+
&opal_ddt_verbose);
187+
if (0 > ret) {
188+
return ret;
189+
}
180190
#if OPAL_CUDA_SUPPORT
181191
/* Set different levels of verbosity in the cuda related code. */
182192
ret = mca_base_var_register ("opal", "opal", NULL, "cuda_verbose",
183193
"Set level of opal cuda verbosity",
184-
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
194+
MCA_BASE_VAR_TYPE_INT, NULL, -1, MCA_BASE_VAR_FLAG_SETTABLE,
185195
OPAL_INFO_LVL_8, MCA_BASE_VAR_SCOPE_LOCAL,
186196
&opal_cuda_verbose);
187197
if (0 > ret) {
@@ -226,6 +236,12 @@ int32_t opal_datatype_init( void )
226236
datatype->desc.desc[1].end_loop.size = datatype->size;
227237
}
228238

239+
/* Enable a private output stream for datatype */
240+
if( opal_ddt_verbose > 0 ) {
241+
opal_datatype_dfd = opal_output_open(NULL);
242+
opal_output_set_verbosity(opal_datatype_dfd, opal_ddt_verbose);
243+
}
244+
229245
return OPAL_SUCCESS;
230246
}
231247

0 commit comments

Comments
 (0)