Skip to content

Commit d141bf7

Browse files
committed
Update the datatype dump to match the actual types.
Update the comments to better reflect what is going on. Minor indentations. Signed-off-by: George Bosilca <[email protected]>
1 parent b82a082 commit d141bf7

File tree

5 files changed

+81
-77
lines changed

5 files changed

+81
-77
lines changed

ompi/datatype/ompi_datatype_module.c

+9-9
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-2019 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,
@@ -759,14 +759,14 @@ void ompi_datatype_dump( const ompi_datatype_t* pData )
759759
length = length * 100 + 500;
760760
buffer = (char*)malloc( length );
761761
index += snprintf( buffer, length - index,
762-
"Datatype %p[%s] id %d size %ld align %d opal_id %d length %d used %d\n"
763-
"true_lb %ld true_ub %ld (true_extent %ld) lb %ld ub %ld (extent %ld)\n"
764-
"nbElems %d loops %d flags %X (",
765-
(void*)pData, pData->name, pData->id,
766-
(long)pData->super.size, (int)pData->super.align, pData->super.id, (int)pData->super.desc.length, (int)pData->super.desc.used,
767-
(long)pData->super.true_lb, (long)pData->super.true_ub, (long)(pData->super.true_ub - pData->super.true_lb),
768-
(long)pData->super.lb, (long)pData->super.ub, (long)(pData->super.ub - pData->super.lb),
769-
(int)pData->super.nbElems, (int)pData->super.loops, (int)pData->super.flags );
762+
"Datatype %p[%s] id %d size %" PRIsize_t " align %u opal_id %u length %" PRIsize_t " used %" PRIsize_t "\n"
763+
"true_lb %td true_ub %td (true_extent %td) lb %td ub %td (extent %td)\n"
764+
"nbElems %" PRIsize_t " loops %u flags %X (",
765+
(void*)pData, pData->name, pData->id,
766+
pData->super.size, pData->super.align, (uint32_t)pData->super.id, pData->super.desc.length, pData->super.desc.used,
767+
pData->super.true_lb, pData->super.true_ub, pData->super.true_ub - pData->super.true_lb,
768+
pData->super.lb, pData->super.ub, pData->super.ub - pData->super.lb,
769+
pData->super.nbElems, pData->super.loops, (int)pData->super.flags );
770770
/* dump the flags */
771771
if( ompi_datatype_is_predefined(pData) ) {
772772
index += snprintf( buffer + index, length - index, "predefined " );

opal/datatype/opal_convertor.c

+4-4
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,
@@ -699,12 +699,12 @@ int opal_convertor_clone( const opal_convertor_t* source,
699699

700700
void opal_convertor_dump( opal_convertor_t* convertor )
701701
{
702-
opal_output( 0, "Convertor %p count %" PRIsize_t" stack position %d bConverted %" PRIsize_t "\n"
703-
"\tlocal_size %ld remote_size %ld flags %X stack_size %d pending_length %" PRIsize_t "\n"
702+
opal_output( 0, "Convertor %p count %" PRIsize_t " stack position %u bConverted %" PRIsize_t "\n"
703+
"\tlocal_size %" PRIsize_t " remote_size %" PRIsize_t " flags %X stack_size %u pending_length %" PRIsize_t "\n"
704704
"\tremote_arch %u local_arch %u\n",
705705
(void*)convertor,
706706
convertor->count, convertor->stack_pos, convertor->bConverted,
707-
(unsigned long)convertor->local_size, (unsigned long)convertor->remote_size,
707+
convertor->local_size, convertor->remote_size,
708708
convertor->flags, convertor->stack_size, convertor->partial_length,
709709
convertor->remoteArch, opal_local_arch );
710710
if( convertor->flags & CONVERTOR_RECV ) opal_output( 0, "unpack ");

opal/datatype/opal_convertor_raw.c

+15-15
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232

3333
/**
3434
* This function always work in local representation. This means no representation
35-
* conversion (i.e. no heterogeneity) has to be taken into account, and that all
35+
* conversion (i.e. no heterogeneity) is taken into account, and that all
3636
* length we're working on are local.
3737
*/
3838
int32_t
3939
opal_convertor_raw( opal_convertor_t* pConvertor,
40-
struct iovec* iov, uint32_t* iov_count,
41-
size_t* length )
40+
struct iovec* iov, uint32_t* iov_count,
41+
size_t* length )
4242
{
4343
const opal_datatype_t *pData = pConvertor->pDesc;
4444
dt_stack_t* pStack; /* pointer to the position on the stack */
@@ -77,9 +77,9 @@ opal_convertor_raw( opal_convertor_t* pConvertor,
7777
description = pConvertor->use_desc->desc;
7878

7979
/* For the first step we have to add both displacement to the source. After in the
80-
* main while loop we will set back the source_base to the correct value. This is
81-
* due to the fact that the convertor can stop in the middle of a data with a count
82-
*/
80+
* main while loop we will set back the source_base to the correct value. This is
81+
* due to the fact that the convertor can stop in the middle of a data with a count
82+
*/
8383
pStack = pConvertor->pStack + pConvertor->stack_pos;
8484
pos_desc = pStack->index;
8585
source_base = pConvertor->pBaseBuf + pStack->disp;
@@ -101,9 +101,9 @@ opal_convertor_raw( opal_convertor_t* pConvertor,
101101
blength *= count_desc;
102102
/* now here we have a basic datatype */
103103
OPAL_DATATYPE_SAFEGUARD_POINTER( source_base, blength, pConvertor->pBaseBuf,
104-
pConvertor->pDesc, pConvertor->count );
104+
pConvertor->pDesc, pConvertor->count );
105105
DO_DEBUG( opal_output( 0, "raw 1. iov[%d] = {base %p, length %" PRIsize_t "}\n",
106-
index, (void*)source_base, (unsigned long)blength ); );
106+
index, (void*)source_base, blength ); );
107107
iov[index].iov_base = (IOVBASE_TYPE *) source_base;
108108
iov[index].iov_len = blength;
109109
source_base += blength;
@@ -114,9 +114,9 @@ opal_convertor_raw( opal_convertor_t* pConvertor,
114114
} else {
115115
for(size_t i = count_desc; (i > 0) && (index < *iov_count); i--, index++ ) {
116116
OPAL_DATATYPE_SAFEGUARD_POINTER( source_base, blength, pConvertor->pBaseBuf,
117-
pConvertor->pDesc, pConvertor->count );
117+
pConvertor->pDesc, pConvertor->count );
118118
DO_DEBUG( opal_output( 0, "raw 2. iov[%d] = {base %p, length %" PRIsize_t "}\n",
119-
index, (void*)source_base, (unsigned long)blength ); );
119+
index, (void*)source_base, blength ); );
120120
iov[index].iov_base = (IOVBASE_TYPE *) source_base;
121121
iov[index].iov_len = blength;
122122
source_base += pElem->elem.extent;
@@ -141,8 +141,8 @@ opal_convertor_raw( opal_convertor_t* pConvertor,
141141
if( --(pStack->count) == 0 ) { /* end of loop */
142142
if( pConvertor->stack_pos == 0 ) {
143143
/* we lie about the size of the next element in order to
144-
* make sure we exit the main loop.
145-
*/
144+
* make sure we exit the main loop.
145+
*/
146146
*iov_count = index;
147147
goto complete_loop; /* completed */
148148
}
@@ -174,7 +174,7 @@ opal_convertor_raw( opal_convertor_t* pConvertor,
174174
source_base += offset;
175175
for(size_t i = MIN(count_desc, *iov_count - index); i > 0; i--, index++ ) {
176176
OPAL_DATATYPE_SAFEGUARD_POINTER( source_base, end_loop->size, pConvertor->pBaseBuf,
177-
pConvertor->pDesc, pConvertor->count );
177+
pConvertor->pDesc, pConvertor->count );
178178
iov[index].iov_base = (IOVBASE_TYPE *) source_base;
179179
iov[index].iov_len = end_loop->size;
180180
source_base += pElem->loop.extent;
@@ -198,14 +198,14 @@ opal_convertor_raw( opal_convertor_t* pConvertor,
198198
PUSH_STACK( pStack, pConvertor->stack_pos, pos_desc, OPAL_DATATYPE_LOOP, count_desc,
199199
pStack->disp + local_disp);
200200
pos_desc++;
201-
update_loop_description: /* update the current state */
201+
update_loop_description: /* update the current state */
202202
source_base = pConvertor->pBaseBuf + pStack->disp;
203203
UPDATE_INTERNAL_COUNTERS( description, pos_desc, pElem, count_desc );
204204
DDT_DUMP_STACK( pConvertor->pStack, pConvertor->stack_pos, pElem, "advance loop" );
205205
continue;
206206
}
207207
}
208-
complete_loop:
208+
complete_loop:
209209
pConvertor->bConverted += raw_data; /* update the already converted bytes */
210210
*length = raw_data;
211211
*iov_count = index;

opal/datatype/opal_datatype_dump.c

+18-18
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-2019 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,
@@ -64,7 +64,7 @@ int opal_datatype_dump_data_flags( unsigned short usflags, char* ptr, size_t len
6464
int index = 0;
6565
if( length < 22 ) return 0;
6666
index = snprintf( ptr, 22, "-----------[---][---]" ); /* set everything to - */
67-
if( usflags & OPAL_DATATYPE_FLAG_COMMITTED ) ptr[1] = 'c';
67+
if( usflags & OPAL_DATATYPE_FLAG_COMMITTED ) ptr[1] = 'c';
6868
if( usflags & OPAL_DATATYPE_FLAG_CONTIGUOUS ) ptr[2] = 'C';
6969
if( usflags & OPAL_DATATYPE_FLAG_OVERLAP ) ptr[3] = 'o';
7070
if( usflags & OPAL_DATATYPE_FLAG_USER_LB ) ptr[4] = 'l';
@@ -90,17 +90,17 @@ int opal_datatype_dump_data_desc( dt_elem_desc_t* pDesc, int nbElems, char* ptr,
9090
index += snprintf( ptr + index, length - index, "%15s ", opal_datatype_basicDatatypes[pDesc->elem.common.type]->name );
9191
if( length <= (size_t)index ) break;
9292
if( OPAL_DATATYPE_LOOP == pDesc->elem.common.type )
93-
index += snprintf( ptr + index, length - index, "%d times the next %d elements extent %d\n",
94-
(int)pDesc->loop.loops, (int)pDesc->loop.items,
95-
(int)pDesc->loop.extent );
93+
index += snprintf( ptr + index, length - index, "%u times the next %u elements extent %td\n",
94+
pDesc->loop.loops, pDesc->loop.items,
95+
pDesc->loop.extent );
9696
else if( OPAL_DATATYPE_END_LOOP == pDesc->elem.common.type )
97-
index += snprintf( ptr + index, length - index, "prev %d elements first elem displacement %ld size of data %d\n",
98-
(int)pDesc->end_loop.items, (long)pDesc->end_loop.first_elem_disp,
99-
(int)pDesc->end_loop.size );
97+
index += snprintf( ptr + index, length - index, "prev %u elements first elem displacement %td size of data %" PRIsize_t "\n",
98+
pDesc->end_loop.items, pDesc->end_loop.first_elem_disp,
99+
pDesc->end_loop.size );
100100
else
101-
index += snprintf( ptr + index, length - index, "count %" PRIsize_t " disp 0x%lx (%ld) blen %d extent %ld (size %ld)\n",
102-
pDesc->elem.count, (long)pDesc->elem.disp, (long)pDesc->elem.disp, (int)pDesc->elem.blocklen,
103-
pDesc->elem.extent, (long)(pDesc->elem.count * opal_datatype_basicDatatypes[pDesc->elem.common.type]->size) );
101+
index += snprintf( ptr + index, length - index, "count %" PRIsize_t " disp 0x%tx (%td) blen %u extent %td (size %zd)\n",
102+
pDesc->elem.count, pDesc->elem.disp, pDesc->elem.disp, pDesc->elem.blocklen,
103+
pDesc->elem.extent, (pDesc->elem.count * pDesc->elem.blocklen * opal_datatype_basicDatatypes[pDesc->elem.common.type]->size) );
104104
pDesc++;
105105

106106
if( length <= (size_t)index ) break;
@@ -118,13 +118,13 @@ void opal_datatype_dump( const opal_datatype_t* pData )
118118
length = pData->opt_desc.used + pData->desc.used;
119119
length = length * 100 + 500;
120120
buffer = (char*)malloc( length );
121-
index += snprintf( buffer, length - index, "Datatype %p[%s] size %ld align %d id %d length %d used %d\n"
122-
"true_lb %ld true_ub %ld (true_extent %ld) lb %ld ub %ld (extent %ld)\n"
123-
"nbElems %" PRIsize_t " loops %d flags %X (",
124-
(void*)pData, pData->name, (long)pData->size, (int)pData->align, pData->id, (int)pData->desc.length, (int)pData->desc.used,
125-
(long)pData->true_lb, (long)pData->true_ub, (long)(pData->true_ub - pData->true_lb),
126-
(long)pData->lb, (long)pData->ub, (long)(pData->ub - pData->lb),
127-
pData->nbElems, (int)pData->loops, (int)pData->flags );
121+
index += snprintf( buffer, length - index, "Datatype %p[%s] size %" PRIsize_t " align %u id %u length %" PRIsize_t " used %" PRIsize_t "\n"
122+
"true_lb %td true_ub %td (true_extent %td) lb %td ub %td (extent %td)\n"
123+
"nbElems %" PRIsize_t " loops %u flags %X (",
124+
(void*)pData, pData->name, pData->size, pData->align, (uint32_t)pData->id, pData->desc.length, pData->desc.used,
125+
pData->true_lb, pData->true_ub, pData->true_ub - pData->true_lb,
126+
pData->lb, pData->ub, pData->ub - pData->lb,
127+
pData->nbElems, pData->loops, (int)pData->flags );
128128
/* dump the flags */
129129
if( pData->flags == OPAL_DATATYPE_FLAG_PREDEFINED )
130130
index += snprintf( buffer + index, length - index, "predefined " );

0 commit comments

Comments
 (0)