1
1

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 <bosilca@icl.utk.edu>
Этот коммит содержится в:
George Bosilca 2019-05-08 13:08:48 -04:00
родитель b82a08254f
Коммит d141bf7912
5 изменённых файлов: 81 добавлений и 77 удалений

Просмотреть файл

@ -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-2019 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
@ -759,14 +759,14 @@ void ompi_datatype_dump( const ompi_datatype_t* pData )
length = length * 100 + 500;
buffer = (char*)malloc( length );
index += snprintf( buffer, length - index,
"Datatype %p[%s] id %d size %ld align %d opal_id %d length %d used %d\n"
"true_lb %ld true_ub %ld (true_extent %ld) lb %ld ub %ld (extent %ld)\n"
"nbElems %d loops %d flags %X (",
"Datatype %p[%s] id %d size %" PRIsize_t " align %u opal_id %u length %" PRIsize_t " used %" PRIsize_t "\n"
"true_lb %td true_ub %td (true_extent %td) lb %td ub %td (extent %td)\n"
"nbElems %" PRIsize_t " loops %u flags %X (",
(void*)pData, pData->name, pData->id,
(long)pData->super.size, (int)pData->super.align, pData->super.id, (int)pData->super.desc.length, (int)pData->super.desc.used,
(long)pData->super.true_lb, (long)pData->super.true_ub, (long)(pData->super.true_ub - pData->super.true_lb),
(long)pData->super.lb, (long)pData->super.ub, (long)(pData->super.ub - pData->super.lb),
(int)pData->super.nbElems, (int)pData->super.loops, (int)pData->super.flags );
pData->super.size, pData->super.align, (uint32_t)pData->super.id, pData->super.desc.length, pData->super.desc.used,
pData->super.true_lb, pData->super.true_ub, pData->super.true_ub - pData->super.true_lb,
pData->super.lb, pData->super.ub, pData->super.ub - pData->super.lb,
pData->super.nbElems, pData->super.loops, (int)pData->super.flags );
/* dump the flags */
if( ompi_datatype_is_predefined(pData) ) {
index += snprintf( buffer + index, length - index, "predefined " );

Просмотреть файл

@ -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,
@ -699,12 +699,12 @@ int opal_convertor_clone( const opal_convertor_t* source,
void opal_convertor_dump( opal_convertor_t* convertor )
{
opal_output( 0, "Convertor %p count %" PRIsize_t" stack position %d bConverted %" PRIsize_t "\n"
"\tlocal_size %ld remote_size %ld flags %X stack_size %d pending_length %" PRIsize_t "\n"
opal_output( 0, "Convertor %p count %" PRIsize_t " stack position %u bConverted %" PRIsize_t "\n"
"\tlocal_size %" PRIsize_t " remote_size %" PRIsize_t " flags %X stack_size %u pending_length %" PRIsize_t "\n"
"\tremote_arch %u local_arch %u\n",
(void*)convertor,
convertor->count, convertor->stack_pos, convertor->bConverted,
(unsigned long)convertor->local_size, (unsigned long)convertor->remote_size,
convertor->local_size, convertor->remote_size,
convertor->flags, convertor->stack_size, convertor->partial_length,
convertor->remoteArch, opal_local_arch );
if( convertor->flags & CONVERTOR_RECV ) opal_output( 0, "unpack ");

Просмотреть файл

@ -32,7 +32,7 @@
/**
* This function always work in local representation. This means no representation
* conversion (i.e. no heterogeneity) has to be taken into account, and that all
* conversion (i.e. no heterogeneity) is taken into account, and that all
* length we're working on are local.
*/
int32_t
@ -103,7 +103,7 @@ opal_convertor_raw( opal_convertor_t* pConvertor,
OPAL_DATATYPE_SAFEGUARD_POINTER( source_base, blength, pConvertor->pBaseBuf,
pConvertor->pDesc, pConvertor->count );
DO_DEBUG( opal_output( 0, "raw 1. iov[%d] = {base %p, length %" PRIsize_t "}\n",
index, (void*)source_base, (unsigned long)blength ); );
index, (void*)source_base, blength ); );
iov[index].iov_base = (IOVBASE_TYPE *) source_base;
iov[index].iov_len = blength;
source_base += blength;
@ -116,7 +116,7 @@ opal_convertor_raw( opal_convertor_t* pConvertor,
OPAL_DATATYPE_SAFEGUARD_POINTER( source_base, blength, pConvertor->pBaseBuf,
pConvertor->pDesc, pConvertor->count );
DO_DEBUG( opal_output( 0, "raw 2. iov[%d] = {base %p, length %" PRIsize_t "}\n",
index, (void*)source_base, (unsigned long)blength ); );
index, (void*)source_base, blength ); );
iov[index].iov_base = (IOVBASE_TYPE *) source_base;
iov[index].iov_len = blength;
source_base += pElem->elem.extent;

Просмотреть файл

@ -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-2019 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
@ -90,17 +90,17 @@ int opal_datatype_dump_data_desc( dt_elem_desc_t* pDesc, int nbElems, char* ptr,
index += snprintf( ptr + index, length - index, "%15s ", opal_datatype_basicDatatypes[pDesc->elem.common.type]->name );
if( length <= (size_t)index ) break;
if( OPAL_DATATYPE_LOOP == pDesc->elem.common.type )
index += snprintf( ptr + index, length - index, "%d times the next %d elements extent %d\n",
(int)pDesc->loop.loops, (int)pDesc->loop.items,
(int)pDesc->loop.extent );
index += snprintf( ptr + index, length - index, "%u times the next %u elements extent %td\n",
pDesc->loop.loops, pDesc->loop.items,
pDesc->loop.extent );
else if( OPAL_DATATYPE_END_LOOP == pDesc->elem.common.type )
index += snprintf( ptr + index, length - index, "prev %d elements first elem displacement %ld size of data %d\n",
(int)pDesc->end_loop.items, (long)pDesc->end_loop.first_elem_disp,
(int)pDesc->end_loop.size );
index += snprintf( ptr + index, length - index, "prev %u elements first elem displacement %td size of data %" PRIsize_t "\n",
pDesc->end_loop.items, pDesc->end_loop.first_elem_disp,
pDesc->end_loop.size );
else
index += snprintf( ptr + index, length - index, "count %" PRIsize_t " disp 0x%lx (%ld) blen %d extent %ld (size %ld)\n",
pDesc->elem.count, (long)pDesc->elem.disp, (long)pDesc->elem.disp, (int)pDesc->elem.blocklen,
pDesc->elem.extent, (long)(pDesc->elem.count * opal_datatype_basicDatatypes[pDesc->elem.common.type]->size) );
index += snprintf( ptr + index, length - index, "count %" PRIsize_t " disp 0x%tx (%td) blen %u extent %td (size %zd)\n",
pDesc->elem.count, pDesc->elem.disp, pDesc->elem.disp, pDesc->elem.blocklen,
pDesc->elem.extent, (pDesc->elem.count * pDesc->elem.blocklen * opal_datatype_basicDatatypes[pDesc->elem.common.type]->size) );
pDesc++;
if( length <= (size_t)index ) break;
@ -118,13 +118,13 @@ void opal_datatype_dump( const opal_datatype_t* pData )
length = pData->opt_desc.used + pData->desc.used;
length = length * 100 + 500;
buffer = (char*)malloc( length );
index += snprintf( buffer, length - index, "Datatype %p[%s] size %ld align %d id %d length %d used %d\n"
"true_lb %ld true_ub %ld (true_extent %ld) lb %ld ub %ld (extent %ld)\n"
"nbElems %" PRIsize_t " loops %d flags %X (",
(void*)pData, pData->name, (long)pData->size, (int)pData->align, pData->id, (int)pData->desc.length, (int)pData->desc.used,
(long)pData->true_lb, (long)pData->true_ub, (long)(pData->true_ub - pData->true_lb),
(long)pData->lb, (long)pData->ub, (long)(pData->ub - pData->lb),
pData->nbElems, (int)pData->loops, (int)pData->flags );
index += snprintf( buffer, length - index, "Datatype %p[%s] size %" PRIsize_t " align %u id %u length %" PRIsize_t " used %" PRIsize_t "\n"
"true_lb %td true_ub %td (true_extent %td) lb %td ub %td (extent %td)\n"
"nbElems %" PRIsize_t " loops %u flags %X (",
(void*)pData, pData->name, pData->size, pData->align, (uint32_t)pData->id, pData->desc.length, pData->desc.used,
pData->true_lb, pData->true_ub, pData->true_ub - pData->true_lb,
pData->lb, pData->ub, pData->ub - pData->lb,
pData->nbElems, pData->loops, (int)pData->flags );
/* dump the flags */
if( pData->flags == OPAL_DATATYPE_FLAG_PREDEFINED )
index += snprintf( buffer + index, length - index, "predefined " );

Просмотреть файл

@ -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-2019 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
@ -89,12 +89,12 @@ static int test_upper( unsigned int length )
}
/**
* Conversion function. They deal with data-types in 3 ways, always making local copies.
* Conversion function. They deal with datatypes in 3 ways, always making local copies.
* In order to allow performance testings, there are 3 functions:
* - one copying directly from one memory location to another one using the
* data-type copy function.
* - one which use a 2 convertors created with the same data-type
* - and one using 2 convertors created from different data-types.
* datatype copy function.
* - one which use a 2 convertors created with the same datatype
* - and one using 2 convertors created from different datatypes.
*
*/
static int local_copy_ddt_raw( ompi_datatype_t* pdt, int count, int iov_num )
@ -141,11 +141,15 @@ static int local_copy_ddt_raw( ompi_datatype_t* pdt, int count, int iov_num )
}
/**
* Main function. Call several tests and print-out the results. It try to stress the convertor
* using difficult data-type constructions as well as strange segment sizes for the conversion.
* Usually, it is able to detect most of the data-type and convertor problems. Any modifications
* on the data-type engine should first pass all the tests from this file, before going into other
* tests.
* Go over a set of datatypes and copy them using the raw functionality provided by the
* convertor. The goal of this test is to stress the convertor using several more or less
* difficult datatype, with a large set of segment sizes for the conversion. It can be used
* to highlight the raw capability of the convertor as well as detecting datatype convertor
* problems.
*
* This test is part of the testing infrastructure for the core datatype engine. As such any
* modifications on the datatype engine should first pass all the tests from this file,
* before going into other tests.
*/
int main( int argc, char* argv[] )
{
@ -231,7 +235,7 @@ int main( int argc, char* argv[] )
OBJ_RELEASE( pdt3 ); assert( pdt3 == NULL );
printf( ">>--------------------------------------------<<\n" );
printf( " Contiguous data-type (MPI_DOUBLE)\n" );
printf( " Contiguous datatype (MPI_DOUBLE)\n" );
pdt = MPI_DOUBLE;
if( outputFlags & CHECK_PACK_UNPACK ) {
local_copy_ddt_raw(pdt, 4500, iov_num);
@ -240,34 +244,34 @@ int main( int argc, char* argv[] )
printf( ">>--------------------------------------------<<\n" );
if( outputFlags & CHECK_PACK_UNPACK ) {
printf( "Contiguous multiple data-type (4500*1)\n" );
printf( "Contiguous multiple datatype (4500*1)\n" );
pdt = create_contiguous_type( MPI_DOUBLE, 4500 );
local_copy_ddt_raw(pdt, 1, iov_num);
OBJ_RELEASE( pdt ); assert( pdt == NULL );
printf( "Contiguous multiple data-type (450*10)\n" );
printf( "Contiguous multiple datatype (450*10)\n" );
pdt = create_contiguous_type( MPI_DOUBLE, 450 );
local_copy_ddt_raw(pdt, 10, iov_num);
OBJ_RELEASE( pdt ); assert( pdt == NULL );
printf( "Contiguous multiple data-type (45*100)\n" );
printf( "Contiguous multiple datatype (45*100)\n" );
pdt = create_contiguous_type( MPI_DOUBLE, 45 );
local_copy_ddt_raw(pdt, 100, iov_num);
OBJ_RELEASE( pdt ); assert( pdt == NULL );
printf( "Contiguous multiple data-type (100*45)\n" );
printf( "Contiguous multiple datatype (100*45)\n" );
pdt = create_contiguous_type( MPI_DOUBLE, 100 );
local_copy_ddt_raw(pdt, 45, iov_num);
OBJ_RELEASE( pdt ); assert( pdt == NULL );
printf( "Contiguous multiple data-type (10*450)\n" );
printf( "Contiguous multiple datatype (10*450)\n" );
pdt = create_contiguous_type( MPI_DOUBLE, 10 );
local_copy_ddt_raw(pdt, 450, iov_num);
OBJ_RELEASE( pdt ); assert( pdt == NULL );
printf( "Contiguous multiple data-type (1*4500)\n" );
printf( "Contiguous multiple datatype (1*4500)\n" );
pdt = create_contiguous_type( MPI_DOUBLE, 1 );
local_copy_ddt_raw(pdt, 4500, iov_num);
OBJ_RELEASE( pdt ); assert( pdt == NULL );
}
printf( ">>--------------------------------------------<<\n" );
printf( ">>--------------------------------------------<<\n" );
printf( "Vector data-type (450 times 10 double stride 11)\n" );
printf( "Vector datatype (450 times 10 double stride 11)\n" );
pdt = create_vector_type( MPI_DOUBLE, 450, 10, 11 );
if( outputFlags & DUMP_DATA_AFTER_COMMIT ) {
ompi_datatype_dump( pdt );