Cleanups ...
This commit was SVN r7420.
Этот коммит содержится в:
родитель
9da5fc2d65
Коммит
a7db1763e2
@ -100,7 +100,7 @@ inline int32_t ompi_convertor_unpack( ompi_convertor_t* pConv,
|
|||||||
size_t* max_data, int32_t* freeAfter )
|
size_t* max_data, int32_t* freeAfter )
|
||||||
{
|
{
|
||||||
const ompi_datatype_t *pData = pConv->pDesc;
|
const ompi_datatype_t *pData = pConv->pDesc;
|
||||||
|
|
||||||
/* protect against over unpacking data */
|
/* protect against over unpacking data */
|
||||||
if( pConv->bConverted == (pData->size * pConv->count) ) {
|
if( pConv->bConverted == (pData->size * pConv->count) ) {
|
||||||
iov[0].iov_len = 0;
|
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;
|
count = starting_point / pData->size;
|
||||||
}
|
}
|
||||||
extent = pData->ub - pData->lb;
|
extent = pData->ub - pData->lb;
|
||||||
|
|
||||||
pStack[0].disp = count * extent;
|
pStack[0].disp = count * extent;
|
||||||
pStack[0].count -= count;
|
pStack[0].count -= count;
|
||||||
|
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||||
* All rights reserved.
|
* 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.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
*
|
*
|
||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ int32_t ompi_ddt_finalize( void );
|
|||||||
ompi_datatype_t* ompi_ddt_create( int32_t expectedSize );
|
ompi_datatype_t* ompi_ddt_create( int32_t expectedSize );
|
||||||
int32_t ompi_ddt_commit( ompi_datatype_t** );
|
int32_t ompi_ddt_commit( ompi_datatype_t** );
|
||||||
int32_t ompi_ddt_destroy( 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); }
|
{ return ((type->flags & DT_FLAG_COMMITED) == DT_FLAG_COMMITED); }
|
||||||
static inline int32_t ompi_ddt_is_overlapped( const ompi_datatype_t* type )
|
static inline int32_t ompi_ddt_is_overlapped( const ompi_datatype_t* type )
|
||||||
{ return ((type->flags & DT_FLAG_OVERLAP) == DT_FLAG_OVERLAP); }
|
{ 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; }
|
{ *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)
|
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; }
|
{ *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
|
* This function return true (1) if the datatype representation depending on the count
|
||||||
* is contiguous in the memory. And false (0) otherwise.
|
* 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 * ca, long* a,
|
||||||
int32_t * cd, ompi_datatype_t** d, int32_t * type);
|
int32_t * cd, ompi_datatype_t** d, int32_t * type);
|
||||||
OMPI_DECLSPEC int32_t ompi_ddt_set_args( ompi_datatype_t* pData,
|
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 ca, long* a,
|
||||||
int32_t cd, ompi_datatype_t** d,int32_t type);
|
int32_t cd, ompi_datatype_t** d,int32_t type);
|
||||||
OMPI_DECLSPEC int32_t ompi_ddt_release_args( ompi_datatype_t* pData );
|
OMPI_DECLSPEC int32_t ompi_ddt_release_args( ompi_datatype_t* pData );
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||||
* All rights reserved.
|
* 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.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
*
|
*
|
||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||||
* All rights reserved.
|
* 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.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
*
|
*
|
||||||
* $HEADER$
|
* $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
|
* be sure that the pdtBase datatype is correctly initialized with all fields
|
||||||
* set to ZERO if it's a empty datatype.
|
* 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 count, long disp, long extent )
|
||||||
{
|
{
|
||||||
uint32_t newLength, place_needed = 0, i;
|
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);
|
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 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
|
* 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
|
* 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 ) {
|
if( count == 0 ) {
|
||||||
return OMPI_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
pdtBase->bdt_used |= pdtAdd->bdt_used;
|
pdtBase->bdt_used |= pdtAdd->bdt_used;
|
||||||
newLength = pdtBase->desc.used + place_needed;
|
newLength = pdtBase->desc.used + place_needed;
|
||||||
if( newLength > pdtBase->desc.length ) {
|
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;
|
pdtBase->desc.used += 2;
|
||||||
pLast++;
|
pLast++;
|
||||||
}
|
}
|
||||||
|
|
||||||
for( i = 0; i < pdtAdd->desc.used; i++ ) {
|
for( i = 0; i < pdtAdd->desc.used; i++ ) {
|
||||||
pLast->elem = pdtAdd->desc.desc[i].elem;
|
pLast->elem = pdtAdd->desc.desc[i].elem;
|
||||||
pLast->elem.common.flags |= localFlags;
|
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);
|
UNSET_CONTIGUOUS_FLAG(pdtBase->flags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pdtBase->nbElems += (count * pdtAdd->nbElems);
|
pdtBase->nbElems += (count * pdtAdd->nbElems);
|
||||||
|
|
||||||
return OMPI_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
|
@ -3,14 +3,14 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||||
* All rights reserved.
|
* 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.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
*
|
*
|
||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ typedef struct __dt_args {
|
|||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
int32_t ompi_ddt_set_args( ompi_datatype_t* pData,
|
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 ca, MPI_Aint* a,
|
||||||
int32_t cd, MPI_Datatype* d, int32_t type)
|
int32_t cd, MPI_Datatype* d, int32_t type)
|
||||||
{
|
{
|
||||||
@ -105,7 +105,7 @@ int32_t ompi_ddt_set_args( ompi_datatype_t* pData,
|
|||||||
break;
|
break;
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
case MPI_COMBINER_INDEXED_BLOCK:
|
case MPI_COMBINER_INDEXED_BLOCK:
|
||||||
pArgs->i[0] = i[0][0];
|
pArgs->i[0] = i[0][0];
|
||||||
pArgs->i[1] = i[1][0];
|
pArgs->i[1] = i[1][0];
|
||||||
memcpy( pArgs->i + 2, i[2], i[0][0] * sizeof(int) );
|
memcpy( pArgs->i + 2, i[2], i[0][0] * sizeof(int) );
|
||||||
break;
|
break;
|
||||||
@ -161,7 +161,7 @@ int32_t ompi_ddt_set_args( ompi_datatype_t* pData,
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* copy the array of MPI_Aint */
|
/* copy the array of MPI_Aint */
|
||||||
if( pArgs->a != NULL )
|
if( pArgs->a != NULL )
|
||||||
memcpy( pArgs->a, a, ca * sizeof(MPI_Aint) );
|
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;
|
*type = pArgs->create_type;
|
||||||
break;
|
break;
|
||||||
case 1: /* GET THE ARGUMENTS */
|
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;
|
return MPI_ERR_ARG;
|
||||||
if( pArgs->i != NULL )
|
if( pArgs->i != NULL )
|
||||||
memcpy( i, pArgs->i, pArgs->ci * sizeof(int) );
|
memcpy( i, pArgs->i, pArgs->ci * sizeof(int) );
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||||
* All rights reserved.
|
* 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.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
*
|
*
|
||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||||
* All rights reserved.
|
* 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.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
*
|
*
|
||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||||
* All rights reserved.
|
* 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.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
*
|
*
|
||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ int32_t ompi_ddt_duplicate( const ompi_datatype_t* oldType, ompi_datatype_t** ne
|
|||||||
return OMPI_SUCCESS;
|
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** newType )
|
||||||
{
|
{
|
||||||
ompi_datatype_t* pdt = ompi_ddt_create( oldType->desc.used + 2 );
|
ompi_datatype_t* pdt = ompi_ddt_create( oldType->desc.used + 2 );
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||||
* All rights reserved.
|
* 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.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
*
|
*
|
||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||||
* All rights reserved.
|
* 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.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
*
|
*
|
||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||||
* All rights reserved.
|
* 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.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
*
|
*
|
||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||||
* All rights reserved.
|
* 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.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
*
|
*
|
||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -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 )
|
const ompi_datatype_t* ompi_ddt_match_size( int size, uint16_t datakind, uint16_t datalang )
|
||||||
{
|
{
|
||||||
if( datalang == DT_FLAG_DATA_CPP ) {
|
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 );
|
return ompi_ddt_match_size_internal( size, datakind, datalang );
|
||||||
datalang = DT_FLAG_DATA_C;
|
datalang = DT_FLAG_DATA_C;
|
||||||
}
|
}
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||||
* All rights reserved.
|
* 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.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
*
|
*
|
||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ int ompi_ddt_dfd = -1;
|
|||||||
INIT_BASIC_TYPE( TYPE, NAME )
|
INIT_BASIC_TYPE( TYPE, NAME )
|
||||||
#endif /* OMPI_WANT_F77_BINDINGS */
|
#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,
|
{ BASEOBJ_DATA, 0, 0, 0, 0,
|
||||||
0, 0, DT_FLAG_PREDEFINED, 0, 1,
|
0, 0, DT_FLAG_PREDEFINED, 0, 1,
|
||||||
((long long)0), EMPTY_DATA(DATATYPE_NULL) };
|
((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];
|
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 = (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.common.type = i;
|
||||||
datatype->desc.desc[0].elem.count = 1;
|
datatype->desc.desc[0].elem.count = 1;
|
||||||
datatype->desc.desc[0].elem.disp = 0;
|
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.
|
* 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.
|
* can call OBJ_DESTRUCT, just to free all internally allocated ressources.
|
||||||
*/
|
*/
|
||||||
for( i = 0; i < DT_MAX_PREDEFINED; i++ ) {
|
for( i = 0; i < DT_MAX_PREDEFINED; i++ ) {
|
||||||
OBJ_DESTRUCT( ompi_ddt_basicDatatypes[i] );
|
OBJ_DESTRUCT( ompi_ddt_basicDatatypes[i] );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get rid of the Fortran2C translation table */
|
/* Get rid of the Fortran2C translation table */
|
||||||
OBJ_RELEASE(ompi_datatype_f_to_c_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;
|
ptr[12] = 'C'; ptr[13] = 'P'; ptr[14] = 'P'; break;
|
||||||
case DT_FLAG_DATA_FORTRAN:
|
case DT_FLAG_DATA_FORTRAN:
|
||||||
ptr[12] = 'F'; ptr[13] = '7'; ptr[14] = '7'; break;
|
ptr[12] = 'F'; ptr[13] = '7'; ptr[14] = '7'; break;
|
||||||
default:
|
default:
|
||||||
if( usflags & DT_FLAG_PREDEFINED ) {
|
if( usflags & DT_FLAG_PREDEFINED ) {
|
||||||
ptr[12] = 'E'; ptr[13] = 'R'; ptr[14] = 'R'; break;
|
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;
|
int i;
|
||||||
size_t index = 0;
|
size_t index = 0;
|
||||||
unsigned long long mask = 1;
|
unsigned long long mask = 1;
|
||||||
|
|
||||||
if( pData->flags & DT_FLAG_USER_LB ) index += snprintf( ptr, length - index, "lb " );
|
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 " );
|
if( pData->flags & DT_FLAG_USER_UB ) index += snprintf( ptr + index, length - index, "ub " );
|
||||||
for( i = 0; i < DT_MAX_PREDEFINED; i++ ) {
|
for( i = 0; i < DT_MAX_PREDEFINED; i++ ) {
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||||
* All rights reserved.
|
* 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.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
*
|
*
|
||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
static int32_t
|
static int32_t
|
||||||
ompi_ddt_optimize_short( ompi_datatype_t* pData,
|
ompi_ddt_optimize_short( ompi_datatype_t* pData,
|
||||||
int32_t count,
|
int32_t count,
|
||||||
dt_type_desc_t* pTypeDesc )
|
dt_type_desc_t* pTypeDesc )
|
||||||
{
|
{
|
||||||
dt_elem_desc_t* pElemDesc;
|
dt_elem_desc_t* pElemDesc;
|
||||||
@ -100,7 +100,7 @@ ompi_ddt_optimize_short( ompi_datatype_t* pData,
|
|||||||
pElemDesc++; nbElems++;
|
pElemDesc++; nbElems++;
|
||||||
last_disp += last_length;
|
last_disp += last_length;
|
||||||
last_length = 0;
|
last_length = 0;
|
||||||
}
|
}
|
||||||
/* we have a gap in the begining or the end of the loop but the whole
|
/* we have a gap in the begining or the end of the loop but the whole
|
||||||
* loop can be merged in just one memcpy.
|
* 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 */
|
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 */
|
/* now here we have a basic datatype */
|
||||||
type = pData->desc.desc[pos_desc].elem.common.type;
|
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) &&
|
(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) ) {
|
(pData->desc.desc[pos_desc].elem.extent == (int32_t)ompi_ddt_basicDatatypes[type]->size) ) {
|
||||||
if( type == last_type ) {
|
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_length = pData->desc.desc[pos_desc].elem.count;
|
||||||
last_extent = pData->desc.desc[pos_desc].elem.extent;
|
last_extent = pData->desc.desc[pos_desc].elem.extent;
|
||||||
} else {
|
} 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;
|
pData->desc.desc[pos_desc].elem.count * ompi_ddt_basicDatatypes[type]->size;
|
||||||
last_type = DT_BYTE;
|
last_type = DT_BYTE;
|
||||||
last_extent = 1;
|
last_extent = 1;
|
||||||
@ -168,7 +168,7 @@ ompi_ddt_optimize_short( ompi_datatype_t* pData,
|
|||||||
pos_desc++; /* advance to the next data */
|
pos_desc++; /* advance to the next data */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( last_length != 0 ) {
|
if( last_length != 0 ) {
|
||||||
CREATE_ELEM( pElemDesc, DT_BYTE, DT_FLAG_BASIC, last_length, last_disp, last_extent );
|
CREATE_ELEM( pElemDesc, DT_BYTE, DT_FLAG_BASIC, last_length, last_disp, last_extent );
|
||||||
pElemDesc++; nbElems++;
|
pElemDesc++; nbElems++;
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||||
* All rights reserved.
|
* 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.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
*
|
*
|
||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ int ompi_convertor_pack_general( ompi_convertor_t* pConvertor,
|
|||||||
|
|
||||||
DDT_DUMP_STACK( pConvertor->pStack, pConvertor->stack_pos, pElem, "starting" );
|
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( "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 );
|
pStack->index, pStack->count );
|
||||||
|
|
||||||
for( iov_count = 0; iov_count < (*out_size); iov_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;
|
dt_elem_desc_t* pElems;
|
||||||
|
|
||||||
pDestBuf = iov[0].iov_base;
|
pDestBuf = iov[0].iov_base;
|
||||||
|
|
||||||
pElems = pConv->use_desc->desc;
|
pElems = pConv->use_desc->desc;
|
||||||
|
|
||||||
pStack = pConv->pStack + pConv->stack_pos;
|
pStack = pConv->pStack + pConv->stack_pos;
|
||||||
pos_desc = pStack->index;
|
pos_desc = pStack->index;
|
||||||
lastDisp = pStack->disp;
|
lastDisp = pStack->disp;
|
||||||
last_count = pStack->count;
|
last_count = pStack->count;
|
||||||
pStack--;
|
pStack--;
|
||||||
pConv->stack_pos--;
|
pConv->stack_pos--;
|
||||||
|
|
||||||
while( 1 ) {
|
while( 1 ) {
|
||||||
if( DT_END_LOOP == pElems[pos_desc].elem.common.type ) { /* end of the current loop */
|
if( DT_END_LOOP == pElems[pos_desc].elem.common.type ) { /* end of the current loop */
|
||||||
if( --(pStack->count) == 0 ) { /* end of 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;
|
pStack = pConv->pStack + pConv->stack_pos;
|
||||||
destination = iov[0].iov_base;
|
destination = iov[0].iov_base;
|
||||||
source = (char*)pConv->pBaseBuf + pStack->disp;
|
source = (char*)pConv->pBaseBuf + pStack->disp;
|
||||||
|
|
||||||
/* retrieve the context of the last call */
|
/* retrieve the context of the last call */
|
||||||
pos_desc = pStack->index;
|
pos_desc = pStack->index;
|
||||||
pack_elem.count = pStack->count;
|
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 */
|
/* nothing else to do, we act the next time */
|
||||||
} else {
|
} else {
|
||||||
/* Now we have 2 piece of non contiguous memory. One start at source
|
/* 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.
|
* pConv->pBaseBuf + lastDisp with a length of last_blength bytes.
|
||||||
* First we have to pack the old buffer and then we should decide
|
* First we have to pack the old buffer and then we should decide
|
||||||
* what we do with the new one.
|
* 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 */
|
i = pConv->bConverted / pData->size; /* how many we already pack */
|
||||||
pSrc = pConv->pBaseBuf + pStack->disp; /* actual starting point for the conversion */
|
pSrc = pConv->pBaseBuf + pStack->disp; /* actual starting point for the conversion */
|
||||||
|
|
||||||
*freeAfter = 0;
|
*freeAfter = 0;
|
||||||
/* There are some optimizations that can be done if the upper level
|
/* There are some optimizations that can be done if the upper level
|
||||||
* does not provide a buffer.
|
* 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 */
|
/* now special case for big contiguous data with gaps around */
|
||||||
if( pData->size >= IOVEC_MEM_LIMIT ) {
|
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.
|
* with data from the user data description.
|
||||||
*/
|
*/
|
||||||
for( index = iov_count; (i < pConv->count) && (index < (*out_size));
|
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 );
|
return (pConv->bConverted == length );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
uint32_t done, counter;
|
uint32_t done, counter;
|
||||||
|
|
||||||
if( iov[iov_count].iov_base == NULL ) {
|
if( iov[iov_count].iov_base == NULL ) {
|
||||||
iov[iov_count].iov_base = pConv->memAlloc_fn( &(iov[iov_count].iov_len),
|
iov[iov_count].iov_base = pConv->memAlloc_fn( &(iov[iov_count].iov_len),
|
||||||
pConv->memAlloc_userdata );
|
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;
|
total_bytes_converted += iov[iov_count].iov_len;
|
||||||
}
|
}
|
||||||
/* Now update the pSrc pointer. At the end of each parth we have to update
|
/* 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.
|
* it's supposed to be useless from now.
|
||||||
*/
|
*/
|
||||||
pSrc = pConv->pBaseBuf + pStack[0].disp;
|
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_homogeneous_with_memcpy;
|
||||||
convertor->fAdvance = ompi_convertor_pack_no_conversion;
|
convertor->fAdvance = ompi_convertor_pack_no_conversion;
|
||||||
convertor->fAdvance = ompi_convertor_generic_simple_pack;
|
convertor->fAdvance = ompi_convertor_generic_simple_pack;
|
||||||
|
|
||||||
if( datatype->flags & DT_FLAG_CONTIGUOUS ) {
|
if( datatype->flags & DT_FLAG_CONTIGUOUS ) {
|
||||||
convertor->flags |= DT_FLAG_CONTIGUOUS;
|
convertor->flags |= DT_FLAG_CONTIGUOUS;
|
||||||
if( ((datatype->ub - datatype->lb) == (long)datatype->size)
|
if( ((datatype->ub - datatype->lb) == (long)datatype->size)
|
||||||
|
@ -3,14 +3,14 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||||
* All rights reserved.
|
* 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.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
*
|
*
|
||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ int32_t ompi_ddt_sndrcv( void *sbuf, int32_t scount, const ompi_datatype_t* sdty
|
|||||||
return MPI_ERR_TRUNCATE;
|
return MPI_ERR_TRUNCATE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If same datatypes used, just copy. */
|
/* If same datatypes used, just copy. */
|
||||||
if (sdtype == rdtype) {
|
if (sdtype == rdtype) {
|
||||||
max_data = ( scount < rcount ? scount : rcount );
|
max_data = ( scount < rcount ? scount : rcount );
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||||
* All rights reserved.
|
* 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.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
*
|
*
|
||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -191,7 +191,7 @@ static int ompi_convertor_unpack_homogeneous( ompi_convertor_t* pConv,
|
|||||||
pStack = pConv->pStack + pConv->stack_pos;
|
pStack = pConv->pStack + pConv->stack_pos;
|
||||||
pos_desc = pStack->index;
|
pos_desc = pStack->index;
|
||||||
lastDisp = pStack->disp;
|
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",
|
/*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 );*/
|
pConv->stack_pos, pStack->index, pStack->count, lastDisp, pConv->bConverted );*/
|
||||||
pStack--;
|
pStack--;
|
||||||
@ -329,7 +329,7 @@ static int ompi_convertor_unpack_homogeneous_contig( ompi_convertor_t* pConv,
|
|||||||
long extent = pData->ub - pData->lb;
|
long extent = pData->ub - pData->lb;
|
||||||
uint32_t bConverted, length, remaining, i;
|
uint32_t bConverted, length, remaining, i;
|
||||||
dt_stack_t* stack = &(pConv->pStack[1]);
|
dt_stack_t* stack = &(pConv->pStack[1]);
|
||||||
|
|
||||||
for( iov_count = 0; iov_count < (*out_size); iov_count++ ) {
|
for( iov_count = 0; iov_count < (*out_size); iov_count++ ) {
|
||||||
pSrcBuf = (char*)iov[iov_count].iov_base;
|
pSrcBuf = (char*)iov[iov_count].iov_base;
|
||||||
remaining = pConv->count * pData->size - pConv->bConverted;
|
remaining = pConv->count * pData->size - pConv->bConverted;
|
||||||
@ -541,29 +541,29 @@ COPY_CONTIGUOUS_BYTES( bytes, 20 )
|
|||||||
#endif /* REQUIRE_COPY_BYTES_20 */
|
#endif /* REQUIRE_COPY_BYTES_20 */
|
||||||
|
|
||||||
conversion_fct_t ompi_ddt_copy_functions[DT_MAX_PREDEFINED] = {
|
conversion_fct_t ompi_ddt_copy_functions[DT_MAX_PREDEFINED] = {
|
||||||
(conversion_fct_t)NULL, /* DT_LOOP */
|
(conversion_fct_t)NULL, /* DT_LOOP */
|
||||||
(conversion_fct_t)NULL, /* DT_END_LOOP */
|
(conversion_fct_t)NULL, /* DT_END_LOOP */
|
||||||
(conversion_fct_t)NULL, /* DT_LB */
|
(conversion_fct_t)NULL, /* DT_LB */
|
||||||
(conversion_fct_t)NULL, /* DT_UB */
|
(conversion_fct_t)NULL, /* DT_UB */
|
||||||
(conversion_fct_t)copy_char, /* DT_CHAR */
|
(conversion_fct_t)copy_char, /* DT_CHAR */
|
||||||
(conversion_fct_t)copy_char, /* DT_CHARACTER */
|
(conversion_fct_t)copy_char, /* DT_CHARACTER */
|
||||||
(conversion_fct_t)copy_char, /* DT_UNSIGNED_CHAR */
|
(conversion_fct_t)copy_char, /* DT_UNSIGNED_CHAR */
|
||||||
(conversion_fct_t)copy_char, /* DT_BYTE */
|
(conversion_fct_t)copy_char, /* DT_BYTE */
|
||||||
(conversion_fct_t)copy_short, /* DT_SHORT */
|
(conversion_fct_t)copy_short, /* DT_SHORT */
|
||||||
(conversion_fct_t)copy_short, /* DT_UNSIGNED_SHORT */
|
(conversion_fct_t)copy_short, /* DT_UNSIGNED_SHORT */
|
||||||
(conversion_fct_t)copy_int, /* DT_INT */
|
(conversion_fct_t)copy_int, /* DT_INT */
|
||||||
(conversion_fct_t)copy_int, /* DT_UNSIGNED_INT */
|
(conversion_fct_t)copy_int, /* DT_UNSIGNED_INT */
|
||||||
(conversion_fct_t)copy_long, /* DT_LONG */
|
(conversion_fct_t)copy_long, /* DT_LONG */
|
||||||
(conversion_fct_t)copy_long, /* DT_UNSIGNED_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 */
|
||||||
(conversion_fct_t)copy_long_long, /* DT_LONG_LONG_INT */
|
(conversion_fct_t)copy_long_long, /* DT_LONG_LONG_INT */
|
||||||
(conversion_fct_t)copy_long_long, /* DT_UNSIGNED_LONG_LONG */
|
(conversion_fct_t)copy_long_long, /* DT_UNSIGNED_LONG_LONG */
|
||||||
(conversion_fct_t)copy_float, /* DT_FLOAT */
|
(conversion_fct_t)copy_float, /* DT_FLOAT */
|
||||||
(conversion_fct_t)copy_double, /* DT_DOUBLE */
|
(conversion_fct_t)copy_double, /* DT_DOUBLE */
|
||||||
(conversion_fct_t)copy_long_double, /* DT_LONG_DOUBLE */
|
(conversion_fct_t)copy_long_double, /* DT_LONG_DOUBLE */
|
||||||
(conversion_fct_t)copy_complex_float, /* DT_COMPLEX_FLOAT */
|
(conversion_fct_t)copy_complex_float, /* DT_COMPLEX_FLOAT */
|
||||||
(conversion_fct_t)copy_complex_double, /* DT_COMPLEX_DOUBLE */
|
(conversion_fct_t)copy_complex_double, /* DT_COMPLEX_DOUBLE */
|
||||||
(conversion_fct_t)copy_complex_long_double, /* DT_COMPLEX_LONG_DOUBLE */
|
(conversion_fct_t)copy_complex_long_double, /* DT_COMPLEX_LONG_DOUBLE */
|
||||||
(conversion_fct_t)NULL, /* DT_PACKED */
|
(conversion_fct_t)NULL, /* DT_PACKED */
|
||||||
#if OMPI_SIZEOF_FORTRAN_LOGICAL == 1
|
#if OMPI_SIZEOF_FORTRAN_LOGICAL == 1
|
||||||
(conversion_fct_t)copy_bytes_1, /* DT_LOGIC */
|
(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
|
#error Complete me please
|
||||||
#endif
|
#endif
|
||||||
#if (SIZEOF_LONG_DOUBLE + SIZEOF_INT) == 12
|
#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
|
#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
|
#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
|
#else
|
||||||
#error Complete me please
|
#error Complete me please
|
||||||
#endif
|
#endif
|
||||||
#if (SIZEOF_LONG + SIZEOF_INT) == 8
|
#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
|
#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
|
#else
|
||||||
#error Complete me please
|
#error Complete me please
|
||||||
#endif
|
#endif
|
||||||
(conversion_fct_t)copy_2int, /* DT_2INT */
|
(conversion_fct_t)copy_2int, /* DT_2INT */
|
||||||
(conversion_fct_t)NULL, /* DT_SHORT_INT */
|
(conversion_fct_t)NULL, /* DT_SHORT_INT */
|
||||||
(conversion_fct_t)copy_int, /* DT_INTEGER */
|
(conversion_fct_t)copy_int, /* DT_INTEGER */
|
||||||
(conversion_fct_t)copy_float, /* DT_REAL */
|
(conversion_fct_t)copy_float, /* DT_REAL */
|
||||||
(conversion_fct_t)copy_double, /* DT_DBLPREC */
|
(conversion_fct_t)copy_double, /* DT_DBLPREC */
|
||||||
(conversion_fct_t)copy_2float, /* DT_2REAL */
|
(conversion_fct_t)copy_2float, /* DT_2REAL */
|
||||||
(conversion_fct_t)copy_2double, /* DT_2DBLPREC */
|
(conversion_fct_t)copy_2double, /* DT_2DBLPREC */
|
||||||
(conversion_fct_t)copy_2int, /* DT_2INTEGER */
|
(conversion_fct_t)copy_2int, /* DT_2INTEGER */
|
||||||
(conversion_fct_t)copy_wchar, /* DT_WCHAR */
|
(conversion_fct_t)copy_wchar, /* DT_WCHAR */
|
||||||
(conversion_fct_t)copy_2complex_float, /* DT_2COMPLEX */
|
(conversion_fct_t)copy_2complex_float, /* DT_2COMPLEX */
|
||||||
(conversion_fct_t)copy_2complex_double, /* DT_2DOUBLE_COMPLEX */
|
(conversion_fct_t)copy_2complex_double, /* DT_2DOUBLE_COMPLEX */
|
||||||
#if SIZEOF_BOOL == 1
|
#if SIZEOF_BOOL == 1
|
||||||
(conversion_fct_t)copy_bytes_1, /* DT_CXX_BOOL */
|
(conversion_fct_t)copy_bytes_1, /* DT_CXX_BOOL */
|
||||||
#elif SIZEOF_BOOL == 4
|
#elif SIZEOF_BOOL == 4
|
||||||
@ -618,7 +618,7 @@ conversion_fct_t ompi_ddt_copy_functions[DT_MAX_PREDEFINED] = {
|
|||||||
#else
|
#else
|
||||||
#error Complete me please
|
#error Complete me please
|
||||||
#endif
|
#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
|
/* 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;
|
int stack_pos = 0;
|
||||||
dt_elem_desc_t* pElems;
|
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.
|
* This function does not support a iSize bigger than the size of the datatype.
|
||||||
*/
|
*/
|
||||||
assert( (uint32_t)iSize <= datatype->size );
|
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 ) {
|
if( (datatype->flags & DT_FLAG_CONTIGUOUS) == DT_FLAG_CONTIGUOUS ) {
|
||||||
long extent = (datatype->ub - datatype->lb);
|
long extent = (datatype->ub - datatype->lb);
|
||||||
/* Now that we know the datatype is contiguous, we should move the 2 pointers
|
/* 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;
|
pDestBuf += datatype->lb;
|
||||||
pSrcBuf += 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 );
|
MEMCPY( pDestBuf + lastDisp, pSrcBuf + lastDisp, lastLength );
|
||||||
lastDisp += pElems[pos_desc].elem.disp;
|
lastDisp += pElems[pos_desc].elem.disp;
|
||||||
lastLength = BASIC_DDT_FROM_ELEM(pElems[pos_desc])->size;
|
lastLength = BASIC_DDT_FROM_ELEM(pElems[pos_desc])->size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pos_desc++; /* advance to the next data */
|
pos_desc++; /* advance to the next data */
|
||||||
}
|
}
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
||||||
* All rights reserved.
|
* 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.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
*
|
*
|
||||||
* $HEADER$
|
* $HEADER$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -27,10 +27,10 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
int ompi_convertor_create_stack_with_pos_general( ompi_convertor_t* pConvertor,
|
int ompi_convertor_create_stack_with_pos_general( ompi_convertor_t* pConvertor,
|
||||||
int starting_point,
|
int starting_point,
|
||||||
const int* sizes );
|
const int* sizes );
|
||||||
|
|
||||||
static inline size_t
|
static inline size_t
|
||||||
ompi_convertor_compute_remote_size( const ompi_datatype_t* pData, const int* sizes )
|
ompi_convertor_compute_remote_size( const ompi_datatype_t* pData, const int* sizes )
|
||||||
{
|
{
|
||||||
uint32_t i;
|
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++ ) {
|
for( i = DT_CHAR; i < DT_MAX_PREDEFINED; i++ ) {
|
||||||
length += (pData->btypes[i] * sizes[i]);
|
length += (pData->btypes[i] * sizes[i]);
|
||||||
}
|
}
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ompi_convertor_create_stack_with_pos_general( ompi_convertor_t* pConvertor,
|
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 */
|
/* Special case for contiguous datatypes */
|
||||||
int cnt = starting_point / pData->size;
|
int cnt = starting_point / pData->size;
|
||||||
long extent = pData->ub - pData->lb;
|
long extent = pData->ub - pData->lb;
|
||||||
|
|
||||||
loop_length = GET_FIRST_NON_LOOP( pElems );
|
loop_length = GET_FIRST_NON_LOOP( pElems );
|
||||||
pStack[0].disp = pElems[loop_length].elem.disp;
|
pStack[0].disp = pElems[loop_length].elem.disp;
|
||||||
pStack[0].type = DT_LOOP;
|
pStack[0].type = DT_LOOP;
|
||||||
|
@ -158,7 +158,7 @@ int ompi_convertor_generic_simple_pack( ompi_convertor_t* pConvertor,
|
|||||||
count_desc = pStack->count;
|
count_desc = pStack->count;
|
||||||
pStack--;
|
pStack--;
|
||||||
pConvertor->stack_pos--;
|
pConvertor->stack_pos--;
|
||||||
pElem = &(description[pos_desc]);
|
pElem = &(description[pos_desc]);
|
||||||
source_base = pConvertor->pBaseBuf + pStack->disp;
|
source_base = pConvertor->pBaseBuf + pStack->disp;
|
||||||
source = source_base + disp_desc;
|
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( DT_LOOP == pElem->elem.common.type ) {
|
||||||
if( pElem->loop.common.flags & DT_FLAG_CONTIGUOUS ) {
|
if( pElem->loop.common.flags & DT_FLAG_CONTIGUOUS ) {
|
||||||
source = source_base + disp_desc;
|
source = source_base + disp_desc;
|
||||||
PACK_CONTIGUOUS_LOOP( pConvertor, pElem, count_desc,
|
PACK_CONTIGUOUS_LOOP( pConvertor, pElem, count_desc,
|
||||||
source, destination, iov_len_local );
|
source, destination, iov_len_local );
|
||||||
if( 0 == count_desc ) { /* completed */
|
if( 0 == count_desc ) { /* completed */
|
||||||
pos_desc += pElem->loop.items + 1;
|
pos_desc += pElem->loop.items + 1;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user