From a7db1763e21fa2ba94dc479187573c8adef81a3e Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Sun, 18 Sep 2005 12:34:29 +0000 Subject: [PATCH] Cleanups ... This commit was SVN r7420. --- ompi/datatype/convertor.c | 4 +- ompi/datatype/datatype.h | 13 +++-- ompi/datatype/datatype_internal.h | 6 +- ompi/datatype/dt_add.c | 16 +++--- ompi/datatype/dt_args.c | 14 ++--- ompi/datatype/dt_create.c | 6 +- ompi/datatype/dt_create_array.c | 6 +- ompi/datatype/dt_create_dup.c | 8 +-- ompi/datatype/dt_create_indexed.c | 6 +- ompi/datatype/dt_create_struct.c | 6 +- ompi/datatype/dt_create_vector.c | 6 +- ompi/datatype/dt_destroy.c | 6 +- ompi/datatype/dt_match_size.c | 2 +- ompi/datatype/dt_module.c | 18 +++--- ompi/datatype/dt_optimize.c | 18 +++--- ompi/datatype/dt_pack.c | 32 +++++------ ompi/datatype/dt_sndrcv.c | 8 +-- ompi/datatype/dt_unpack.c | 96 +++++++++++++++---------------- ompi/datatype/fake_stack.c | 14 ++--- ompi/datatype/new_pack.c | 4 +- 20 files changed, 145 insertions(+), 144 deletions(-) diff --git a/ompi/datatype/convertor.c b/ompi/datatype/convertor.c index 710b8e85f9..5b141a8638 100644 --- a/ompi/datatype/convertor.c +++ b/ompi/datatype/convertor.c @@ -100,7 +100,7 @@ inline int32_t ompi_convertor_unpack( ompi_convertor_t* pConv, size_t* max_data, int32_t* freeAfter ) { const ompi_datatype_t *pData = pConv->pDesc; - + /* protect against over unpacking data */ if( pConv->bConverted == (pData->size * pConv->count) ) { iov[0].iov_len = 0; @@ -139,7 +139,7 @@ int ompi_convertor_create_stack_with_pos_contig( ompi_convertor_t* pConvertor, count = starting_point / pData->size; } extent = pData->ub - pData->lb; - + pStack[0].disp = count * extent; pStack[0].count -= count; diff --git a/ompi/datatype/datatype.h b/ompi/datatype/datatype.h index c39e170f72..0aae1457d0 100644 --- a/ompi/datatype/datatype.h +++ b/ompi/datatype/datatype.h @@ -4,14 +4,14 @@ * All rights reserved. * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. * All rights reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * $COPYRIGHT$ - * + * * Additional copyrights may follow - * + * * $HEADER$ */ @@ -121,7 +121,7 @@ int32_t ompi_ddt_finalize( void ); ompi_datatype_t* ompi_ddt_create( int32_t expectedSize ); int32_t ompi_ddt_commit( ompi_datatype_t** ); int32_t ompi_ddt_destroy( ompi_datatype_t** ); -static inline int32_t ompi_ddt_is_committed( const ompi_datatype_t* type ) +static inline int32_t ompi_ddt_is_committed( const ompi_datatype_t* type ) { return ((type->flags & DT_FLAG_COMMITED) == DT_FLAG_COMMITED); } static inline int32_t ompi_ddt_is_overlapped( const ompi_datatype_t* type ) { return ((type->flags & DT_FLAG_OVERLAP) == DT_FLAG_OVERLAP); } @@ -169,7 +169,8 @@ static inline int32_t ompi_ddt_get_extent( const ompi_datatype_t* pData, long* l { *lb = pData->lb; *extent = pData->ub - pData->lb; return 0; } static inline int32_t ompi_ddt_get_true_extent( const ompi_datatype_t* pData, long* true_lb, long* true_extent) { *true_lb = pData->true_lb; *true_extent = (pData->true_ub - pData->true_lb); return 0; } - +static inline int32_t ompi_ddt_get_size( const ompi_datatype_t* pData, long* size ) +{ *size = pData->size; return 0; } /* * This function return true (1) if the datatype representation depending on the count * is contiguous in the memory. And false (0) otherwise. @@ -202,7 +203,7 @@ OMPI_DECLSPEC int32_t ompi_ddt_get_args( const ompi_datatype_t* pData, int32_t w int32_t * ca, long* a, int32_t * cd, ompi_datatype_t** d, int32_t * type); OMPI_DECLSPEC int32_t ompi_ddt_set_args( ompi_datatype_t* pData, - int32_t ci, int32_t ** i, + int32_t ci, int32_t ** i, int32_t ca, long* a, int32_t cd, ompi_datatype_t** d,int32_t type); OMPI_DECLSPEC int32_t ompi_ddt_release_args( ompi_datatype_t* pData ); diff --git a/ompi/datatype/datatype_internal.h b/ompi/datatype/datatype_internal.h index f9b92007f8..d64bd6a37e 100644 --- a/ompi/datatype/datatype_internal.h +++ b/ompi/datatype/datatype_internal.h @@ -4,14 +4,14 @@ * All rights reserved. * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. * All rights reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * $COPYRIGHT$ - * + * * Additional copyrights may follow - * + * * $HEADER$ */ diff --git a/ompi/datatype/dt_add.c b/ompi/datatype/dt_add.c index 4ed3849ce3..b256854a91 100644 --- a/ompi/datatype/dt_add.c +++ b/ompi/datatype/dt_add.c @@ -4,14 +4,14 @@ * All rights reserved. * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. * All rights reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * $COPYRIGHT$ - * + * * Additional copyrights may follow - * + * * $HEADER$ */ @@ -70,7 +70,7 @@ static inline int IMIN( int a, int b ) { return ( a < b ? a : b ); } * be sure that the pdtBase datatype is correctly initialized with all fields * set to ZERO if it's a empty datatype. */ -int32_t ompi_ddt_add( ompi_datatype_t* pdtBase, const ompi_datatype_t* pdtAdd, +int32_t ompi_ddt_add( ompi_datatype_t* pdtBase, const ompi_datatype_t* pdtAdd, uint32_t count, long disp, long extent ) { uint32_t newLength, place_needed = 0, i; @@ -181,7 +181,7 @@ int32_t ompi_ddt_add( ompi_datatype_t* pdtBase, const ompi_datatype_t* pdtAdd, pdtBase->ub += (pdtBase->align - epsilon); } - /* + /* * the count == 0 is LEGAL only for MPI_UB and MPI_LB. I accept it just as a nice way to set * the soft UB for a data (without using a real UB marker). This approach can be used to * create the subarray and darray datatype. However from the MPI level this function @@ -190,7 +190,7 @@ int32_t ompi_ddt_add( ompi_datatype_t* pdtBase, const ompi_datatype_t* pdtAdd, if( count == 0 ) { return OMPI_SUCCESS; } - + pdtBase->bdt_used |= pdtAdd->bdt_used; newLength = pdtBase->desc.used + place_needed; if( newLength > pdtBase->desc.length ) { @@ -252,7 +252,7 @@ int32_t ompi_ddt_add( ompi_datatype_t* pdtBase, const ompi_datatype_t* pdtAdd, pdtBase->desc.used += 2; pLast++; } - + for( i = 0; i < pdtAdd->desc.used; i++ ) { pLast->elem = pdtAdd->desc.desc[i].elem; pLast->elem.common.flags |= localFlags; @@ -285,7 +285,7 @@ int32_t ompi_ddt_add( ompi_datatype_t* pdtBase, const ompi_datatype_t* pdtAdd, UNSET_CONTIGUOUS_FLAG(pdtBase->flags); } } - + pdtBase->nbElems += (count * pdtAdd->nbElems); return OMPI_SUCCESS; diff --git a/ompi/datatype/dt_args.c b/ompi/datatype/dt_args.c index 05d631b944..17cec295c7 100644 --- a/ompi/datatype/dt_args.c +++ b/ompi/datatype/dt_args.c @@ -3,14 +3,14 @@ * All rights reserved. * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. * All rights reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * $COPYRIGHT$ - * + * * Additional copyrights may follow - * + * * $HEADER$ */ @@ -56,7 +56,7 @@ typedef struct __dt_args { } while(0) int32_t ompi_ddt_set_args( ompi_datatype_t* pData, - int32_t ci, int32_t** i, + int32_t ci, int32_t** i, int32_t ca, MPI_Aint* a, int32_t cd, MPI_Datatype* d, int32_t type) { @@ -105,7 +105,7 @@ int32_t ompi_ddt_set_args( ompi_datatype_t* pData, break; /******************************************************************/ case MPI_COMBINER_INDEXED_BLOCK: - pArgs->i[0] = i[0][0]; + pArgs->i[0] = i[0][0]; pArgs->i[1] = i[1][0]; memcpy( pArgs->i + 2, i[2], i[0][0] * sizeof(int) ); break; @@ -161,7 +161,7 @@ int32_t ompi_ddt_set_args( ompi_datatype_t* pData, default: break; } - + /* copy the array of MPI_Aint */ if( pArgs->a != NULL ) memcpy( pArgs->a, a, ca * sizeof(MPI_Aint) ); @@ -215,7 +215,7 @@ int32_t ompi_ddt_get_args( const ompi_datatype_t* pData, int32_t which, *type = pArgs->create_type; break; case 1: /* GET THE ARGUMENTS */ - if(*ci < pArgs->ci || *ca < pArgs->ca || *cd < pArgs->cd) + if(*ci < pArgs->ci || *ca < pArgs->ca || *cd < pArgs->cd) return MPI_ERR_ARG; if( pArgs->i != NULL ) memcpy( i, pArgs->i, pArgs->ci * sizeof(int) ); diff --git a/ompi/datatype/dt_create.c b/ompi/datatype/dt_create.c index a81780907e..b9091a0fe0 100644 --- a/ompi/datatype/dt_create.c +++ b/ompi/datatype/dt_create.c @@ -4,14 +4,14 @@ * All rights reserved. * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. * All rights reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * $COPYRIGHT$ - * + * * Additional copyrights may follow - * + * * $HEADER$ */ diff --git a/ompi/datatype/dt_create_array.c b/ompi/datatype/dt_create_array.c index 78de1b07c2..58c4d5f134 100644 --- a/ompi/datatype/dt_create_array.c +++ b/ompi/datatype/dt_create_array.c @@ -4,14 +4,14 @@ * All rights reserved. * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. * All rights reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * $COPYRIGHT$ - * + * * Additional copyrights may follow - * + * * $HEADER$ */ diff --git a/ompi/datatype/dt_create_dup.c b/ompi/datatype/dt_create_dup.c index 1e22a00a80..7964580bfd 100644 --- a/ompi/datatype/dt_create_dup.c +++ b/ompi/datatype/dt_create_dup.c @@ -4,14 +4,14 @@ * All rights reserved. * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. * All rights reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * $COPYRIGHT$ - * + * * Additional copyrights may follow - * + * * $HEADER$ */ @@ -49,7 +49,7 @@ int32_t ompi_ddt_duplicate( const ompi_datatype_t* oldType, ompi_datatype_t** ne return OMPI_SUCCESS; } -int32_t ompi_ddt_create_contiguous( int count, const ompi_datatype_t* oldType, +int32_t ompi_ddt_create_contiguous( int count, const ompi_datatype_t* oldType, ompi_datatype_t** newType ) { ompi_datatype_t* pdt = ompi_ddt_create( oldType->desc.used + 2 ); diff --git a/ompi/datatype/dt_create_indexed.c b/ompi/datatype/dt_create_indexed.c index 547fdb430e..68ebdec21d 100644 --- a/ompi/datatype/dt_create_indexed.c +++ b/ompi/datatype/dt_create_indexed.c @@ -4,14 +4,14 @@ * All rights reserved. * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. * All rights reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * $COPYRIGHT$ - * + * * Additional copyrights may follow - * + * * $HEADER$ */ diff --git a/ompi/datatype/dt_create_struct.c b/ompi/datatype/dt_create_struct.c index 2d31079f0b..b13b00d8e2 100644 --- a/ompi/datatype/dt_create_struct.c +++ b/ompi/datatype/dt_create_struct.c @@ -4,14 +4,14 @@ * All rights reserved. * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. * All rights reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * $COPYRIGHT$ - * + * * Additional copyrights may follow - * + * * $HEADER$ */ diff --git a/ompi/datatype/dt_create_vector.c b/ompi/datatype/dt_create_vector.c index 5c79a8e226..7e31c8d044 100644 --- a/ompi/datatype/dt_create_vector.c +++ b/ompi/datatype/dt_create_vector.c @@ -4,14 +4,14 @@ * All rights reserved. * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. * All rights reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * $COPYRIGHT$ - * + * * Additional copyrights may follow - * + * * $HEADER$ */ diff --git a/ompi/datatype/dt_destroy.c b/ompi/datatype/dt_destroy.c index 229924802c..77f383f5f8 100644 --- a/ompi/datatype/dt_destroy.c +++ b/ompi/datatype/dt_destroy.c @@ -4,14 +4,14 @@ * All rights reserved. * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. * All rights reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * $COPYRIGHT$ - * + * * Additional copyrights may follow - * + * * $HEADER$ */ diff --git a/ompi/datatype/dt_match_size.c b/ompi/datatype/dt_match_size.c index b0ec08e624..169133596c 100644 --- a/ompi/datatype/dt_match_size.c +++ b/ompi/datatype/dt_match_size.c @@ -41,7 +41,7 @@ const ompi_datatype_t* ompi_ddt_match_size_internal( int size, uint16_t datakind const ompi_datatype_t* ompi_ddt_match_size( int size, uint16_t datakind, uint16_t datalang ) { if( datalang == DT_FLAG_DATA_CPP ) { - if( datakind == DT_FLAG_DATA_COMPLEX ) + if( datakind == DT_FLAG_DATA_COMPLEX ) return ompi_ddt_match_size_internal( size, datakind, datalang ); datalang = DT_FLAG_DATA_C; } diff --git a/ompi/datatype/dt_module.c b/ompi/datatype/dt_module.c index c2a8406c30..cf44cf65f4 100644 --- a/ompi/datatype/dt_module.c +++ b/ompi/datatype/dt_module.c @@ -4,14 +4,14 @@ * All rights reserved. * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. * All rights reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * $COPYRIGHT$ - * + * * Additional copyrights may follow - * + * * $HEADER$ */ @@ -59,7 +59,7 @@ int ompi_ddt_dfd = -1; INIT_BASIC_TYPE( TYPE, NAME ) #endif /* OMPI_WANT_F77_BINDINGS */ -OMPI_DECLSPEC ompi_datatype_t ompi_mpi_datatype_null = +OMPI_DECLSPEC ompi_datatype_t ompi_mpi_datatype_null = { BASEOBJ_DATA, 0, 0, 0, 0, 0, 0, DT_FLAG_PREDEFINED, 0, 1, ((long long)0), EMPTY_DATA(DATATYPE_NULL) }; @@ -334,7 +334,7 @@ int32_t ompi_ddt_init( void ) ompi_datatype_t* datatype = (ompi_datatype_t*)ompi_ddt_basicDatatypes[i]; datatype->desc.desc = (dt_elem_desc_t*)malloc(2*sizeof(dt_elem_desc_t)); - datatype->desc.desc[0].elem.common.flags = DT_FLAG_PREDEFINED | DT_FLAG_DATA | DT_FLAG_CONTIGUOUS; + datatype->desc.desc[0].elem.common.flags = DT_FLAG_PREDEFINED | DT_FLAG_DATA | DT_FLAG_CONTIGUOUS; datatype->desc.desc[0].elem.common.type = i; datatype->desc.desc[0].elem.count = 1; datatype->desc.desc[0].elem.disp = 0; @@ -533,13 +533,13 @@ int32_t ompi_ddt_finalize( void ) * Anyway they are over the limit of DT_MAX_PREDEFINED so they will never get freed. */ - /* As they are statically allocated they cannot be released. But we + /* As they are statically allocated they cannot be released. But we * can call OBJ_DESTRUCT, just to free all internally allocated ressources. */ for( i = 0; i < DT_MAX_PREDEFINED; i++ ) { OBJ_DESTRUCT( ompi_ddt_basicDatatypes[i] ); } - + /* Get rid of the Fortran2C translation table */ OBJ_RELEASE(ompi_datatype_f_to_c_table); @@ -581,7 +581,7 @@ static int _dump_data_flags( unsigned short usflags, char* ptr, size_t length ) ptr[12] = 'C'; ptr[13] = 'P'; ptr[14] = 'P'; break; case DT_FLAG_DATA_FORTRAN: ptr[12] = 'F'; ptr[13] = '7'; ptr[14] = '7'; break; - default: + default: if( usflags & DT_FLAG_PREDEFINED ) { ptr[12] = 'E'; ptr[13] = 'R'; ptr[14] = 'R'; break; } @@ -635,7 +635,7 @@ static inline int __dt_contain_basic_datatypes( const ompi_datatype_t* pData, ch int i; size_t index = 0; unsigned long long mask = 1; - + if( pData->flags & DT_FLAG_USER_LB ) index += snprintf( ptr, length - index, "lb " ); if( pData->flags & DT_FLAG_USER_UB ) index += snprintf( ptr + index, length - index, "ub " ); for( i = 0; i < DT_MAX_PREDEFINED; i++ ) { diff --git a/ompi/datatype/dt_optimize.c b/ompi/datatype/dt_optimize.c index 6c3b7f6f1c..0f508720ba 100644 --- a/ompi/datatype/dt_optimize.c +++ b/ompi/datatype/dt_optimize.c @@ -4,14 +4,14 @@ * All rights reserved. * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. * All rights reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * $COPYRIGHT$ - * + * * Additional copyrights may follow - * + * * $HEADER$ */ @@ -27,7 +27,7 @@ static int32_t ompi_ddt_optimize_short( ompi_datatype_t* pData, - int32_t count, + int32_t count, dt_type_desc_t* pTypeDesc ) { dt_elem_desc_t* pElemDesc; @@ -100,7 +100,7 @@ ompi_ddt_optimize_short( ompi_datatype_t* pData, pElemDesc++; nbElems++; last_disp += last_length; last_length = 0; - } + } /* we have a gap in the begining or the end of the loop but the whole * loop can be merged in just one memcpy. */ @@ -134,8 +134,8 @@ ompi_ddt_optimize_short( ompi_datatype_t* pData, while( pData->desc.desc[pos_desc].elem.common.flags & DT_FLAG_DATA ) { /* keep doing it until we reach a non datatype element */ /* now here we have a basic datatype */ type = pData->desc.desc[pos_desc].elem.common.type; - - if( (pData->desc.desc[pos_desc].elem.common.flags & DT_FLAG_CONTIGUOUS) && + + if( (pData->desc.desc[pos_desc].elem.common.flags & DT_FLAG_CONTIGUOUS) && (last_disp + last_length) == (total_disp + pData->desc.desc[pos_desc].elem.disp) && (pData->desc.desc[pos_desc].elem.extent == (int32_t)ompi_ddt_basicDatatypes[type]->size) ) { if( type == last_type ) { @@ -147,7 +147,7 @@ ompi_ddt_optimize_short( ompi_datatype_t* pData, last_length = pData->desc.desc[pos_desc].elem.count; last_extent = pData->desc.desc[pos_desc].elem.extent; } else { - last_length = last_length * ompi_ddt_basicDatatypes[last_type]->size + + last_length = last_length * ompi_ddt_basicDatatypes[last_type]->size + pData->desc.desc[pos_desc].elem.count * ompi_ddt_basicDatatypes[type]->size; last_type = DT_BYTE; last_extent = 1; @@ -168,7 +168,7 @@ ompi_ddt_optimize_short( ompi_datatype_t* pData, pos_desc++; /* advance to the next data */ } } - + if( last_length != 0 ) { CREATE_ELEM( pElemDesc, DT_BYTE, DT_FLAG_BASIC, last_length, last_disp, last_extent ); pElemDesc++; nbElems++; diff --git a/ompi/datatype/dt_pack.c b/ompi/datatype/dt_pack.c index ad38b56a03..38c5eb6b3d 100644 --- a/ompi/datatype/dt_pack.c +++ b/ompi/datatype/dt_pack.c @@ -4,14 +4,14 @@ * All rights reserved. * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. * All rights reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * $COPYRIGHT$ - * + * * Additional copyrights may follow - * + * * $HEADER$ */ @@ -72,7 +72,7 @@ int ompi_convertor_pack_general( ompi_convertor_t* pConvertor, DDT_DUMP_STACK( pConvertor->pStack, pConvertor->stack_pos, pElem, "starting" ); DUMP( "remember position on stack %d last_elem at %d\n", pConvertor->stack_pos, pos_desc ); - DUMP( "top stack info {index = %d, count = %d}\n", + DUMP( "top stack info {index = %d, count = %d}\n", pStack->index, pStack->count ); for( iov_count = 0; iov_count < (*out_size); iov_count++ ) { @@ -186,16 +186,16 @@ int ompi_convertor_pack_homogeneous_with_memcpy( ompi_convertor_t* pConv, dt_elem_desc_t* pElems; pDestBuf = iov[0].iov_base; - - pElems = pConv->use_desc->desc; - + + pElems = pConv->use_desc->desc; + pStack = pConv->pStack + pConv->stack_pos; pos_desc = pStack->index; lastDisp = pStack->disp; last_count = pStack->count; pStack--; pConv->stack_pos--; - + while( 1 ) { if( DT_END_LOOP == pElems[pos_desc].elem.common.type ) { /* end of the current loop */ if( --(pStack->count) == 0 ) { /* end of loop */ @@ -328,7 +328,7 @@ int ompi_convertor_pack_no_conversion( ompi_convertor_t* pConv, pStack = pConv->pStack + pConv->stack_pos; destination = iov[0].iov_base; source = (char*)pConv->pBaseBuf + pStack->disp; - + /* retrieve the context of the last call */ pos_desc = pStack->index; pack_elem.count = pStack->count; @@ -475,7 +475,7 @@ int ompi_convertor_pack_no_conversion( ompi_convertor_t* pConv, /* nothing else to do, we act the next time */ } else { /* Now we have 2 piece of non contiguous memory. One start at source - * with a length of saveLength, the other start at + * with a length of saveLength, the other start at * pConv->pBaseBuf + lastDisp with a length of last_blength bytes. * First we have to pack the old buffer and then we should decide * what we do with the new one. @@ -649,7 +649,7 @@ ompi_convertor_pack_no_conv_contig_with_gaps( ompi_convertor_t* pConv, i = pConv->bConverted / pData->size; /* how many we already pack */ pSrc = pConv->pBaseBuf + pStack->disp; /* actual starting point for the conversion */ - + *freeAfter = 0; /* There are some optimizations that can be done if the upper level * does not provide a buffer. @@ -677,7 +677,7 @@ ompi_convertor_pack_no_conv_contig_with_gaps( ompi_convertor_t* pConv, } /* now special case for big contiguous data with gaps around */ if( pData->size >= IOVEC_MEM_LIMIT ) { - /* as we dont have to copy any data, we can simply fill the iovecs + /* as we dont have to copy any data, we can simply fill the iovecs * with data from the user data description. */ for( index = iov_count; (i < pConv->count) && (index < (*out_size)); @@ -702,10 +702,10 @@ ompi_convertor_pack_no_conv_contig_with_gaps( ompi_convertor_t* pConv, return (pConv->bConverted == length ); } } - + { uint32_t done, counter; - + if( iov[iov_count].iov_base == NULL ) { iov[iov_count].iov_base = pConv->memAlloc_fn( &(iov[iov_count].iov_len), pConv->memAlloc_userdata ); @@ -741,7 +741,7 @@ ompi_convertor_pack_no_conv_contig_with_gaps( ompi_convertor_t* pConv, total_bytes_converted += iov[iov_count].iov_len; } /* Now update the pSrc pointer. At the end of each parth we have to update - * the pStack[0].disp field. BEWARE here we remove the pStack[1].disp as + * the pStack[0].disp field. BEWARE here we remove the pStack[1].disp as * it's supposed to be useless from now. */ pSrc = pConv->pBaseBuf + pStack[0].disp; @@ -771,7 +771,7 @@ ompi_convertor_prepare_for_send( ompi_convertor_t* convertor, convertor->fAdvance = ompi_convertor_pack_homogeneous_with_memcpy; convertor->fAdvance = ompi_convertor_pack_no_conversion; convertor->fAdvance = ompi_convertor_generic_simple_pack; - + if( datatype->flags & DT_FLAG_CONTIGUOUS ) { convertor->flags |= DT_FLAG_CONTIGUOUS; if( ((datatype->ub - datatype->lb) == (long)datatype->size) diff --git a/ompi/datatype/dt_sndrcv.c b/ompi/datatype/dt_sndrcv.c index 16e4994f3a..71f1e2344a 100644 --- a/ompi/datatype/dt_sndrcv.c +++ b/ompi/datatype/dt_sndrcv.c @@ -3,14 +3,14 @@ * All rights reserved. * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. * All rights reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * $COPYRIGHT$ - * + * * Additional copyrights may follow - * + * * $HEADER$ */ @@ -56,7 +56,7 @@ int32_t ompi_ddt_sndrcv( void *sbuf, int32_t scount, const ompi_datatype_t* sdty return MPI_ERR_TRUNCATE; } } - + /* If same datatypes used, just copy. */ if (sdtype == rdtype) { max_data = ( scount < rcount ? scount : rcount ); diff --git a/ompi/datatype/dt_unpack.c b/ompi/datatype/dt_unpack.c index 57d0c980ea..a83bcf96fe 100644 --- a/ompi/datatype/dt_unpack.c +++ b/ompi/datatype/dt_unpack.c @@ -4,14 +4,14 @@ * All rights reserved. * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. * All rights reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * $COPYRIGHT$ - * + * * Additional copyrights may follow - * + * * $HEADER$ */ @@ -191,7 +191,7 @@ static int ompi_convertor_unpack_homogeneous( ompi_convertor_t* pConv, pStack = pConv->pStack + pConv->stack_pos; pos_desc = pStack->index; lastDisp = pStack->disp; - last_count = pStack->count; + last_count = pStack->count; /*opal_output( 0, "ompi_convertor_unpack_homogeneous stack_pos %d index %d count %d lastDisp %ld bConverted %d\n", pConv->stack_pos, pStack->index, pStack->count, lastDisp, pConv->bConverted );*/ pStack--; @@ -329,7 +329,7 @@ static int ompi_convertor_unpack_homogeneous_contig( ompi_convertor_t* pConv, long extent = pData->ub - pData->lb; uint32_t bConverted, length, remaining, i; dt_stack_t* stack = &(pConv->pStack[1]); - + for( iov_count = 0; iov_count < (*out_size); iov_count++ ) { pSrcBuf = (char*)iov[iov_count].iov_base; remaining = pConv->count * pData->size - pConv->bConverted; @@ -541,29 +541,29 @@ COPY_CONTIGUOUS_BYTES( bytes, 20 ) #endif /* REQUIRE_COPY_BYTES_20 */ conversion_fct_t ompi_ddt_copy_functions[DT_MAX_PREDEFINED] = { - (conversion_fct_t)NULL, /* DT_LOOP */ - (conversion_fct_t)NULL, /* DT_END_LOOP */ - (conversion_fct_t)NULL, /* DT_LB */ - (conversion_fct_t)NULL, /* DT_UB */ - (conversion_fct_t)copy_char, /* DT_CHAR */ - (conversion_fct_t)copy_char, /* DT_CHARACTER */ - (conversion_fct_t)copy_char, /* DT_UNSIGNED_CHAR */ - (conversion_fct_t)copy_char, /* DT_BYTE */ - (conversion_fct_t)copy_short, /* DT_SHORT */ - (conversion_fct_t)copy_short, /* DT_UNSIGNED_SHORT */ - (conversion_fct_t)copy_int, /* DT_INT */ - (conversion_fct_t)copy_int, /* DT_UNSIGNED_INT */ - (conversion_fct_t)copy_long, /* DT_LONG */ - (conversion_fct_t)copy_long, /* DT_UNSIGNED_LONG */ - (conversion_fct_t)copy_long_long, /* DT_LONG_LONG */ - (conversion_fct_t)copy_long_long, /* DT_LONG_LONG_INT */ - (conversion_fct_t)copy_long_long, /* DT_UNSIGNED_LONG_LONG */ - (conversion_fct_t)copy_float, /* DT_FLOAT */ - (conversion_fct_t)copy_double, /* DT_DOUBLE */ - (conversion_fct_t)copy_long_double, /* DT_LONG_DOUBLE */ - (conversion_fct_t)copy_complex_float, /* DT_COMPLEX_FLOAT */ - (conversion_fct_t)copy_complex_double, /* DT_COMPLEX_DOUBLE */ - (conversion_fct_t)copy_complex_long_double, /* DT_COMPLEX_LONG_DOUBLE */ + (conversion_fct_t)NULL, /* DT_LOOP */ + (conversion_fct_t)NULL, /* DT_END_LOOP */ + (conversion_fct_t)NULL, /* DT_LB */ + (conversion_fct_t)NULL, /* DT_UB */ + (conversion_fct_t)copy_char, /* DT_CHAR */ + (conversion_fct_t)copy_char, /* DT_CHARACTER */ + (conversion_fct_t)copy_char, /* DT_UNSIGNED_CHAR */ + (conversion_fct_t)copy_char, /* DT_BYTE */ + (conversion_fct_t)copy_short, /* DT_SHORT */ + (conversion_fct_t)copy_short, /* DT_UNSIGNED_SHORT */ + (conversion_fct_t)copy_int, /* DT_INT */ + (conversion_fct_t)copy_int, /* DT_UNSIGNED_INT */ + (conversion_fct_t)copy_long, /* DT_LONG */ + (conversion_fct_t)copy_long, /* DT_UNSIGNED_LONG */ + (conversion_fct_t)copy_long_long, /* DT_LONG_LONG */ + (conversion_fct_t)copy_long_long, /* DT_LONG_LONG_INT */ + (conversion_fct_t)copy_long_long, /* DT_UNSIGNED_LONG_LONG */ + (conversion_fct_t)copy_float, /* DT_FLOAT */ + (conversion_fct_t)copy_double, /* DT_DOUBLE */ + (conversion_fct_t)copy_long_double, /* DT_LONG_DOUBLE */ + (conversion_fct_t)copy_complex_float, /* DT_COMPLEX_FLOAT */ + (conversion_fct_t)copy_complex_double, /* DT_COMPLEX_DOUBLE */ + (conversion_fct_t)copy_complex_long_double, /* DT_COMPLEX_LONG_DOUBLE */ (conversion_fct_t)NULL, /* DT_PACKED */ #if OMPI_SIZEOF_FORTRAN_LOGICAL == 1 (conversion_fct_t)copy_bytes_1, /* DT_LOGIC */ @@ -583,32 +583,32 @@ conversion_fct_t ompi_ddt_copy_functions[DT_MAX_PREDEFINED] = { #error Complete me please #endif #if (SIZEOF_LONG_DOUBLE + SIZEOF_INT) == 12 - (conversion_fct_t)copy_bytes_12, /* DT_LONG_DOUBLE_INT */ + (conversion_fct_t)copy_bytes_12, /* DT_LONG_DOUBLE_INT */ #elif (SIZEOF_LONG_DOUBLE + SIZEOF_INT) == 16 - (conversion_fct_t)copy_bytes_16, /* DT_LONG_DOUBLE_INT */ + (conversion_fct_t)copy_bytes_16, /* DT_LONG_DOUBLE_INT */ #elif (SIZEOF_LONG_DOUBLE + SIZEOF_INT) == 20 - (conversion_fct_t)copy_bytes_20, /* DT_LONG_DOUBLE_INT */ + (conversion_fct_t)copy_bytes_20, /* DT_LONG_DOUBLE_INT */ #else #error Complete me please #endif #if (SIZEOF_LONG + SIZEOF_INT) == 8 - (conversion_fct_t)copy_bytes_8, /* DT_LONG_INT */ + (conversion_fct_t)copy_bytes_8, /* DT_LONG_INT */ #elif (SIZEOF_LONG + SIZEOF_INT) == 12 - (conversion_fct_t)copy_bytes_12, /* DT_LONG_INT */ + (conversion_fct_t)copy_bytes_12, /* DT_LONG_INT */ #else #error Complete me please #endif - (conversion_fct_t)copy_2int, /* DT_2INT */ - (conversion_fct_t)NULL, /* DT_SHORT_INT */ - (conversion_fct_t)copy_int, /* DT_INTEGER */ - (conversion_fct_t)copy_float, /* DT_REAL */ - (conversion_fct_t)copy_double, /* DT_DBLPREC */ - (conversion_fct_t)copy_2float, /* DT_2REAL */ - (conversion_fct_t)copy_2double, /* DT_2DBLPREC */ - (conversion_fct_t)copy_2int, /* DT_2INTEGER */ - (conversion_fct_t)copy_wchar, /* DT_WCHAR */ - (conversion_fct_t)copy_2complex_float, /* DT_2COMPLEX */ - (conversion_fct_t)copy_2complex_double, /* DT_2DOUBLE_COMPLEX */ + (conversion_fct_t)copy_2int, /* DT_2INT */ + (conversion_fct_t)NULL, /* DT_SHORT_INT */ + (conversion_fct_t)copy_int, /* DT_INTEGER */ + (conversion_fct_t)copy_float, /* DT_REAL */ + (conversion_fct_t)copy_double, /* DT_DBLPREC */ + (conversion_fct_t)copy_2float, /* DT_2REAL */ + (conversion_fct_t)copy_2double, /* DT_2DBLPREC */ + (conversion_fct_t)copy_2int, /* DT_2INTEGER */ + (conversion_fct_t)copy_wchar, /* DT_WCHAR */ + (conversion_fct_t)copy_2complex_float, /* DT_2COMPLEX */ + (conversion_fct_t)copy_2complex_double, /* DT_2DOUBLE_COMPLEX */ #if SIZEOF_BOOL == 1 (conversion_fct_t)copy_bytes_1, /* DT_CXX_BOOL */ #elif SIZEOF_BOOL == 4 @@ -618,7 +618,7 @@ conversion_fct_t ompi_ddt_copy_functions[DT_MAX_PREDEFINED] = { #else #error Complete me please #endif - (conversion_fct_t)NULL, /* DT_UNAVAILABLE */ + (conversion_fct_t)NULL, /* DT_UNAVAILABLE */ }; /* Should we supply buffers to the convertor or can we use directly @@ -693,7 +693,7 @@ int32_t ompi_ddt_get_element_count( const ompi_datatype_t* datatype, int32_t iSi int stack_pos = 0; dt_elem_desc_t* pElems; - /* Normally the size should be less or equal to the size of the datatype. + /* Normally the size should be less or equal to the size of the datatype. * This function does not support a iSize bigger than the size of the datatype. */ assert( (uint32_t)iSize <= datatype->size ); @@ -776,7 +776,7 @@ int32_t ompi_ddt_copy_content_same_ddt( const ompi_datatype_t* datatype, int32_t if( (datatype->flags & DT_FLAG_CONTIGUOUS) == DT_FLAG_CONTIGUOUS ) { long extent = (datatype->ub - datatype->lb); /* Now that we know the datatype is contiguous, we should move the 2 pointers - * source and destination to the correct displacement. + * source and destination to the correct displacement. */ pDestBuf += datatype->lb; pSrcBuf += datatype->lb; @@ -875,7 +875,7 @@ int32_t ompi_ddt_copy_content_same_ddt( const ompi_datatype_t* datatype, int32_t MEMCPY( pDestBuf + lastDisp, pSrcBuf + lastDisp, lastLength ); lastDisp += pElems[pos_desc].elem.disp; lastLength = BASIC_DDT_FROM_ELEM(pElems[pos_desc])->size; - } + } } pos_desc++; /* advance to the next data */ } diff --git a/ompi/datatype/fake_stack.c b/ompi/datatype/fake_stack.c index 42d3a37fd7..268d5992b3 100644 --- a/ompi/datatype/fake_stack.c +++ b/ompi/datatype/fake_stack.c @@ -4,14 +4,14 @@ * All rights reserved. * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. * All rights reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * $COPYRIGHT$ - * + * * Additional copyrights may follow - * + * * $HEADER$ */ @@ -27,10 +27,10 @@ #include int ompi_convertor_create_stack_with_pos_general( ompi_convertor_t* pConvertor, - int starting_point, + int starting_point, const int* sizes ); -static inline size_t +static inline size_t ompi_convertor_compute_remote_size( const ompi_datatype_t* pData, const int* sizes ) { uint32_t i; @@ -39,7 +39,7 @@ ompi_convertor_compute_remote_size( const ompi_datatype_t* pData, const int* siz for( i = DT_CHAR; i < DT_MAX_PREDEFINED; i++ ) { length += (pData->btypes[i] * sizes[i]); } - return length; + return length; } int ompi_convertor_create_stack_with_pos_general( ompi_convertor_t* pConvertor, @@ -75,7 +75,7 @@ int ompi_convertor_create_stack_with_pos_general( ompi_convertor_t* pConvertor, /* Special case for contiguous datatypes */ int cnt = starting_point / pData->size; long extent = pData->ub - pData->lb; - + loop_length = GET_FIRST_NON_LOOP( pElems ); pStack[0].disp = pElems[loop_length].elem.disp; pStack[0].type = DT_LOOP; diff --git a/ompi/datatype/new_pack.c b/ompi/datatype/new_pack.c index 7f072386ef..fb63ea7e95 100644 --- a/ompi/datatype/new_pack.c +++ b/ompi/datatype/new_pack.c @@ -158,7 +158,7 @@ int ompi_convertor_generic_simple_pack( ompi_convertor_t* pConvertor, count_desc = pStack->count; pStack--; pConvertor->stack_pos--; - pElem = &(description[pos_desc]); + pElem = &(description[pos_desc]); source_base = pConvertor->pBaseBuf + pStack->disp; source = source_base + disp_desc; @@ -215,7 +215,7 @@ int ompi_convertor_generic_simple_pack( ompi_convertor_t* pConvertor, if( DT_LOOP == pElem->elem.common.type ) { if( pElem->loop.common.flags & DT_FLAG_CONTIGUOUS ) { source = source_base + disp_desc; - PACK_CONTIGUOUS_LOOP( pConvertor, pElem, count_desc, + PACK_CONTIGUOUS_LOOP( pConvertor, pElem, count_desc, source, destination, iov_len_local ); if( 0 == count_desc ) { /* completed */ pos_desc += pElem->loop.items + 1;