1
1

Use coherent types over all files.

This commit was SVN r4630.
Этот коммит содержится в:
George Bosilca 2005-03-02 14:21:22 +00:00
родитель ccc11068ca
Коммит a6974cfc64
15 изменённых файлов: 73 добавлений и 76 удалений

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

@ -137,27 +137,27 @@ static inline int32_t ompi_ddt_is_acceptable_for_one_sided( const ompi_datatype_
void ompi_ddt_dump( const dt_desc_t* pData );
/* data creation functions */
OMPI_DECLSPEC int32_t ompi_ddt_duplicate( const dt_desc_t* oldType, dt_desc_t** newType );
OMPI_DECLSPEC int32_t ompi_ddt_create_contiguous( int32_t count, const dt_desc_t* oldType, dt_desc_t** newType );
OMPI_DECLSPEC int32_t ompi_ddt_create_vector( int32_t count, int32_t bLength, long stride,
OMPI_DECLSPEC int32_t ompi_ddt_create_contiguous( int count, const dt_desc_t* oldType, dt_desc_t** newType );
OMPI_DECLSPEC int32_t ompi_ddt_create_vector( int count, int bLength, long stride,
const dt_desc_t* oldType, dt_desc_t** newType );
OMPI_DECLSPEC int32_t ompi_ddt_create_hvector( int32_t count, int32_t bLength, long stride,
OMPI_DECLSPEC int32_t ompi_ddt_create_hvector( int count, int bLength, long stride,
const dt_desc_t* oldType, dt_desc_t** newType );
OMPI_DECLSPEC int32_t ompi_ddt_create_indexed( int32_t count, const int* pBlockLength, const int* pDisp,
OMPI_DECLSPEC int32_t ompi_ddt_create_indexed( int count, const int* pBlockLength, const int* pDisp,
const dt_desc_t* oldType, dt_desc_t** newType );
OMPI_DECLSPEC int32_t ompi_ddt_create_hindexed( int32_t count, const int* pBlockLength, const long* pDisp,
OMPI_DECLSPEC int32_t ompi_ddt_create_hindexed( int count, const int* pBlockLength, const long* pDisp,
const dt_desc_t* oldType, dt_desc_t** newType );
OMPI_DECLSPEC int32_t ompi_ddt_create_indexed_block( int32_t count, int32_t bLength, const int* pDisp,
OMPI_DECLSPEC int32_t ompi_ddt_create_indexed_block( int count, int bLength, const int* pDisp,
const dt_desc_t* oldType, dt_desc_t** newType );
OMPI_DECLSPEC int32_t ompi_ddt_create_struct( int32_t count, const int* pBlockLength, const long* pDisp,
OMPI_DECLSPEC int32_t ompi_ddt_create_struct( int count, const int* pBlockLength, const long* pDisp,
const dt_desc_t** pTypes, dt_desc_t** newType );
OMPI_DECLSPEC int32_t ompi_ddt_create_resized( const dt_desc_t* oldType, long lb, long extent, dt_desc_t** newType );
OMPI_DECLSPEC int32_t ompi_ddt_create_subarray( int32_t ndims, const int* pSizes,
OMPI_DECLSPEC int32_t ompi_ddt_create_subarray( int ndims, const int* pSizes,
const int* pSubSizes, const int* pStarts,
int32_t order, const dt_desc_t* oldType, dt_desc_t** newType );
OMPI_DECLSPEC int32_t ompi_ddt_create_darray( int32_t size, int32_t rank, int32_t ndims,
const int* pGSizes, const int32_t *pDistrib,
int order, const dt_desc_t* oldType, dt_desc_t** newType );
OMPI_DECLSPEC int32_t ompi_ddt_create_darray( int size, int rank, int ndims,
const int* pGSizes, const int *pDistrib,
const int* pDArgs, const int* pPSizes,
int32_t order, const dt_desc_t* oldType,
int order, const dt_desc_t* oldType,
dt_desc_t** newType );
OMPI_DECLSPEC int32_t ompi_ddt_add( dt_desc_t* pdtBase, const dt_desc_t* pdtAdd, uint32_t count,

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

@ -31,8 +31,8 @@
* be sure that the pdtBase datatype is correctly initialized with all fields
* set to ZERO if it's a empty datatype.
*/
int ompi_ddt_add( dt_desc_t* pdtBase, const dt_desc_t* pdtAdd,
unsigned int count, long disp, long extent )
int32_t ompi_ddt_add( dt_desc_t* pdtBase, const dt_desc_t* pdtAdd,
uint32_t count, long disp, long extent )
{
uint32_t newLength, place_needed = 0, i;
short localFlags = 0; /* no specific options yet */
@ -97,11 +97,8 @@ int ompi_ddt_add( dt_desc_t* pdtBase, const dt_desc_t* pdtAdd,
newLength = pdtBase->desc.used + place_needed;
if( newLength > pdtBase->desc.length ) {
newLength = ((newLength / DT_INCREASE_STACK) + 1 ) * DT_INCREASE_STACK;
printf( "increase the size of the data desc array from %d to %d (old ptr = %p ",
pdtBase->desc.length, newLength, (void*)pdtBase->desc.desc );
pdtBase->desc.desc = (dt_elem_desc_t*)realloc( pdtBase->desc.desc,
sizeof(dt_elem_desc_t) * newLength );
printf( "new ptr = %p\n", (void*)pdtBase->desc.desc );
pdtBase->desc.length = newLength;
}
pLast = &(pdtBase->desc.desc[pdtBase->desc.used]);

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

@ -55,10 +55,10 @@ do { \
#define FREE_ARGS(PDATA) \
if( (PDATA)->args != NULL ) free( (PDATA)->args );
int ompi_ddt_set_args( ompi_datatype_t* pData,
int ci, int ** i,
int ca, MPI_Aint* a,
int cd, MPI_Datatype* d,int type)
int32_t ompi_ddt_set_args( ompi_datatype_t* pData,
int32_t ci, int32_t** i,
int32_t ca, MPI_Aint* a,
int32_t cd, MPI_Datatype* d, int32_t type)
{
int pos;
ompi_ddt_args_t* pArgs;
@ -172,10 +172,10 @@ int ompi_ddt_set_args( ompi_datatype_t* pData,
return MPI_SUCCESS;
}
int ompi_ddt_get_args( const ompi_datatype_t* pData, int which,
int * ci, int * i,
int * ca, MPI_Aint * a,
int * cd, MPI_Datatype * d, int * type)
int32_t ompi_ddt_get_args( const ompi_datatype_t* pData, int32_t which,
int32_t* ci, int32_t* i,
int32_t* ca, MPI_Aint* a,
int32_t* cd, MPI_Datatype* d, int32_t* type)
{
ompi_ddt_args_t* pArgs = pData->args;

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

@ -70,7 +70,7 @@ static void __destroy_ddt_struct( dt_desc_t* pData )
OBJ_CLASS_INSTANCE(ompi_datatype_t, ompi_object_t, __get_free_dt_struct, __destroy_ddt_struct );
dt_desc_t* ompi_ddt_create( int expectedSize )
dt_desc_t* ompi_ddt_create( int32_t expectedSize )
{
dt_desc_t* pdt = (dt_desc_t*)OBJ_NEW(ompi_datatype_t);
@ -82,7 +82,7 @@ dt_desc_t* ompi_ddt_create( int expectedSize )
return pdt;
}
int ompi_ddt_create_resized( const dt_desc_t* oldType, long lb, long extent, dt_desc_t** newType )
int32_t ompi_ddt_create_resized( const dt_desc_t* oldType, long lb, long extent, dt_desc_t** newType )
{
ompi_ddt_duplicate( oldType, newType );
(*newType)->lb = lb;

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

@ -16,13 +16,13 @@
#include "ompi_config.h"
#include "datatype/datatype.h"
int ompi_ddt_create_subarray( int ndims, const int* pSizes, const int* pSubSizes, const int* pStarts,
int32_t ompi_ddt_create_subarray( int ndims, const int* pSizes, const int* pSubSizes, const int* pStarts,
int order, const dt_desc_t* oldType, dt_desc_t** newType )
{
return OMPI_ERR_NOT_IMPLEMENTED;
}
int ompi_ddt_create_darray( int size, int rank, int ndims, const int* pGSizes, const int *pDistrib,
int32_t ompi_ddt_create_darray( int size, int rank, int ndims, const int* pGSizes, const int *pDistrib,
const int* pDArgs, const int* pPSizes, int order, const dt_desc_t* oldType,
dt_desc_t** newType )
{

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

@ -17,7 +17,7 @@
#include "datatype/datatype.h"
#include "datatype/datatype_internal.h"
int ompi_ddt_duplicate( const dt_desc_t* oldType, dt_desc_t** newType )
int32_t ompi_ddt_duplicate( const dt_desc_t* oldType, dt_desc_t** newType )
{
dt_desc_t* pdt = ompi_ddt_create( oldType->desc.used );
void* temp = pdt->desc.desc; /* temporary copy of the desc pointer */
@ -38,8 +38,8 @@ int ompi_ddt_duplicate( const dt_desc_t* oldType, dt_desc_t** newType )
return OMPI_SUCCESS;
}
int ompi_ddt_create_contiguous( int count, const dt_desc_t* oldType,
dt_desc_t** newType )
int32_t ompi_ddt_create_contiguous( int count, const dt_desc_t* oldType,
dt_desc_t** newType )
{
dt_desc_t* pdt = ompi_ddt_create( oldType->desc.used + 2 );
ompi_ddt_add( pdt, oldType, count, 0, (oldType->ub - oldType->lb) );

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

@ -17,8 +17,8 @@
#include "datatype/datatype.h"
/* We try to merge together data that are contiguous */
int ompi_ddt_create_indexed( int count, const int* pBlockLength, const int* pDisp,
const dt_desc_t* oldType, dt_desc_t** newType )
int32_t ompi_ddt_create_indexed( int count, const int* pBlockLength, const int* pDisp,
const dt_desc_t* oldType, dt_desc_t** newType )
{
dt_desc_t* pdt;
int i, dLength, endat, disp;
@ -52,8 +52,8 @@ int ompi_ddt_create_indexed( int count, const int* pBlockLength, const int* pDis
return OMPI_SUCCESS;
}
int ompi_ddt_create_hindexed( int count, const int* pBlockLength, const long* pDisp,
const dt_desc_t* oldType, dt_desc_t** newType )
int32_t ompi_ddt_create_hindexed( int count, const int* pBlockLength, const long* pDisp,
const dt_desc_t* oldType, dt_desc_t** newType )
{
dt_desc_t* pdt;
int i, dLength;
@ -87,8 +87,8 @@ int ompi_ddt_create_hindexed( int count, const int* pBlockLength, const long* pD
return OMPI_SUCCESS;
}
int ompi_ddt_create_indexed_block( int count, int bLength, const int* pDisp,
const dt_desc_t* oldType, dt_desc_t** newType )
int32_t ompi_ddt_create_indexed_block( int count, int bLength, const int* pDisp,
const dt_desc_t* oldType, dt_desc_t** newType )
{
dt_desc_t* pdt;
int i, dLength, endat, disp;

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

@ -16,8 +16,8 @@
#include "ompi_config.h"
#include "datatype/datatype.h"
int ompi_ddt_create_struct( int count, const int* pBlockLength, const long* pDisp,
const dt_desc_t ** pTypes, dt_desc_t** newType )
int32_t ompi_ddt_create_struct( int count, const int* pBlockLength, const long* pDisp,
const dt_desc_t ** pTypes, dt_desc_t** newType )
{
int i;
long disp = 0, endto, lastExtent, lastDisp;

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

@ -22,8 +22,8 @@
*
*/
int ompi_ddt_create_vector( int count, int bLength, long stride,
const dt_desc_t* oldType, dt_desc_t** newType )
int32_t ompi_ddt_create_vector( int count, int bLength, long stride,
const dt_desc_t* oldType, dt_desc_t** newType )
{
long extent = oldType->ub - oldType->lb;
dt_desc_t *pTempData, *pData;
@ -50,8 +50,8 @@ int ompi_ddt_create_vector( int count, int bLength, long stride,
return OMPI_SUCCESS;
}
int ompi_ddt_create_hvector( int count, int bLength, long stride,
const dt_desc_t* oldType, dt_desc_t** newType )
int32_t ompi_ddt_create_hvector( int count, int bLength, long stride,
const dt_desc_t* oldType, dt_desc_t** newType )
{
long extent = oldType->ub - oldType->lb;
dt_desc_t *pTempData, *pData;

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

@ -17,7 +17,7 @@
#include "datatype/datatype.h"
#include "datatype/datatype_internal.h"
int ompi_ddt_destroy( dt_desc_t** dt )
int32_t ompi_ddt_destroy( dt_desc_t** dt )
{
dt_desc_t* pData = *dt;

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

@ -277,7 +277,7 @@ int ompi_ddt_local_sizes[DT_MAX_PREDEFINED];
strncpy( (PDATA)->name, MPIDDTNAME, MPI_MAX_OBJECT_NAME ); \
} while(0)
int ompi_ddt_init( void )
int32_t ompi_ddt_init( void )
{
int i;
@ -463,7 +463,7 @@ int ompi_ddt_init( void )
return OMPI_SUCCESS;
}
int ompi_ddt_finalize( void )
int32_t ompi_ddt_finalize( void )
{
int i;
@ -545,15 +545,15 @@ static int __dump_data_desc( dt_elem_desc_t* pDesc, int nbElems, char* ptr )
if( pDesc->type == DT_LOOP )
index += sprintf( ptr + index, "%15s %d times the next %d elements extent %d\n",
ompi_ddt_basicDatatypes[pDesc->type]->name,
pDesc->count, (int)pDesc->disp, pDesc->extent );
(int)pDesc->count, (int)pDesc->disp, (int)pDesc->extent );
else if( pDesc->type == DT_END_LOOP )
index += sprintf( ptr + index, "%15s prev %d elements total true extent %d size of data %d\n",
ompi_ddt_basicDatatypes[pDesc->type]->name,
pDesc->count, (int)pDesc->disp, pDesc->extent );
(int)pDesc->count, (int)pDesc->disp, (int)pDesc->extent );
else
index += sprintf( ptr + index, "%15s count %d disp 0x%lx (%ld) extent %d\n",
ompi_ddt_basicDatatypes[pDesc->type]->name,
pDesc->count, pDesc->disp, pDesc->disp, pDesc->extent );
(int)pDesc->count, pDesc->disp, pDesc->disp, (int)pDesc->extent );
pDesc++;
}
return index;
@ -582,10 +582,10 @@ void ompi_ddt_dump( const dt_desc_t* pData )
index += sprintf( buffer, "Datatype %p 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 %d loops %d flags %X (",
(void*)pData, pData->size, pData->align, pData->id, pData->desc.length, pData->desc.used,
(void*)pData, pData->size, (int)pData->align, pData->id, (int)pData->desc.length, (int)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->btypes[DT_LOOP], pData->flags );
(int)pData->nbElems, (int)pData->btypes[DT_LOOP], (int)pData->flags );
/* dump the flags */
if( pData->flags == DT_FLAG_BASIC ) index += sprintf( buffer + index, "basic datatype " );
else {

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

@ -44,8 +44,8 @@ do { \
nbElems++; \
} while(0)
int ompi_ddt_optimize_short( dt_desc_t* pData, int count,
dt_type_desc_t* pTypeDesc )
int32_t ompi_ddt_optimize_short( dt_desc_t* pData, int32_t count,
dt_type_desc_t* pTypeDesc )
{
dt_elem_desc_t* pElemDesc;
long lastDisp = 0;
@ -290,7 +290,7 @@ static int ompi_ddt_unroll( dt_desc_t* pData, int count )
}
#endif /* COMPILE_USELSS_CODE */
int ompi_ddt_commit( dt_desc_t** data )
int32_t ompi_ddt_commit( dt_desc_t** data )
{
dt_desc_t* pData = (dt_desc_t*)*data;
dt_endloop_desc_t* pLast = (dt_endloop_desc_t*)&(pData->desc.desc[pData->desc.used]);

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

@ -730,13 +730,13 @@ ompi_convertor_pack_no_conv_contig_with_gaps( ompi_convertor_t* pConv,
}
extern int ompi_ddt_local_sizes[DT_MAX_PREDEFINED];
int ompi_convertor_init_for_send( ompi_convertor_t* pConv,
uint32_t flags,
const dt_desc_t* datatype,
int count,
const void* pUserBuf,
int starting_pos,
memalloc_fct_t allocfn )
int32_t ompi_convertor_init_for_send( ompi_convertor_t* pConv,
uint32_t flags,
const dt_desc_t* datatype,
int32_t count,
const void* pUserBuf,
int32_t starting_pos,
memalloc_fct_t allocfn )
{
if( !(datatype->flags & DT_FLAG_COMMITED) ) {
/* this datatype is improper for conversion. Commit it first */
@ -766,7 +766,7 @@ int ompi_convertor_init_for_send( ompi_convertor_t* pConv,
return ompi_convertor_create_stack_at_begining( pConv, ompi_ddt_local_sizes );
}
ompi_convertor_t* ompi_convertor_create( int remote_arch, int mode )
ompi_convertor_t* ompi_convertor_create( int32_t remote_arch, int32_t mode )
{
ompi_convertor_t* pConv = OBJ_NEW(ompi_convertor_t);
@ -796,9 +796,9 @@ static void ompi_convertor_destruct( ompi_convertor_t* pConv )
OBJ_CLASS_INSTANCE(ompi_convertor_t, ompi_object_t, ompi_convertor_construct, ompi_convertor_destruct );
/* Actually we suppose that we can only do receiver side conversion */
int ompi_convertor_get_packed_size( const ompi_convertor_t* pConv, uint32_t* pSize )
int32_t ompi_convertor_get_packed_size( const ompi_convertor_t* pConv, uint32_t* pSize )
{
int ddt_size = 0;
int32_t ddt_size = 0;
if( ompi_ddt_type_size( pConv->pDesc, &ddt_size ) != 0 )
return OMPI_ERROR;
@ -807,7 +807,7 @@ int ompi_convertor_get_packed_size( const ompi_convertor_t* pConv, uint32_t* pSi
return OMPI_SUCCESS;
}
int ompi_convertor_get_unpacked_size( const ompi_convertor_t* pConv, uint32_t* pSize )
int32_t ompi_convertor_get_unpacked_size( const ompi_convertor_t* pConv, uint32_t* pSize )
{
int i;
dt_desc_t* pData = pConv->pDesc;

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

@ -34,8 +34,8 @@
* - communicator
* Returns: - MPI_SUCCESS or error code
*/
int ompi_ddt_sndrcv( void *sbuf, int scount, const ompi_datatype_t* sdtype,
void *rbuf, int rcount, const ompi_datatype_t* rdtype)
int32_t ompi_ddt_sndrcv( void *sbuf, int32_t scount, const ompi_datatype_t* sdtype,
void *rbuf, int32_t rcount, const ompi_datatype_t* rdtype)
{
int err;
ompi_convertor_t *send_convertor, *recv_convertor;

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

@ -596,17 +596,17 @@ conversion_fct_t ompi_ddt_copy_functions[DT_MAX_PREDEFINED] = {
/* Should we supply buffers to the convertor or can we use directly
* the user buffer ?
*/
int ompi_convertor_need_buffers( ompi_convertor_t* pConvertor )
int32_t ompi_convertor_need_buffers( ompi_convertor_t* pConvertor )
{
if( pConvertor->flags & DT_FLAG_CONTIGUOUS ) return 0;
return 1;
}
extern int ompi_ddt_local_sizes[DT_MAX_PREDEFINED];
int ompi_convertor_init_for_recv( ompi_convertor_t* pConv, uint32_t flags,
const dt_desc_t* datatype, int count,
const void* pUserBuf, int starting_point,
memalloc_fct_t allocfn )
int32_t ompi_convertor_init_for_recv( ompi_convertor_t* pConv, uint32_t flags,
const dt_desc_t* datatype, int32_t count,
const void* pUserBuf, int32_t starting_point,
memalloc_fct_t allocfn )
{
if( !(datatype->flags & DT_FLAG_COMMITED) ) {
/* this datatype is improper for conversion. Commit it first */
@ -640,7 +640,7 @@ int ompi_convertor_init_for_recv( ompi_convertor_t* pConv, uint32_t flags,
* positive = number of basic elements inside
* negative = some error occurs
*/
int ompi_ddt_get_element_count( const dt_desc_t* datatype, int iSize )
int32_t ompi_ddt_get_element_count( const dt_desc_t* datatype, int32_t iSize )
{
dt_stack_t* pStack; /* pointer to the position on the stack */
uint32_t pos_desc; /* actual position in the description of the derived datatype */
@ -704,8 +704,8 @@ int ompi_ddt_get_element_count( const dt_desc_t* datatype, int iSize )
return nbElems;
}
int ompi_ddt_copy_content_same_ddt( const dt_desc_t* datatype, int count,
char* pDestBuf, const char* pSrcBuf )
int32_t ompi_ddt_copy_content_same_ddt( const dt_desc_t* datatype, int32_t count,
char* pDestBuf, const char* pSrcBuf )
{
dt_stack_t* pStack; /* pointer to the position on the stack */
int pos_desc; /* actual position in the description of the derived datatype */