1
1

Correctly play with the flags. Ported from the 1.1 branch.

This commit was SVN r10449.
Этот коммит содержится в:
George Bosilca 2006-06-21 14:05:09 +00:00
родитель 720f38efc5
Коммит 382a0209f7
3 изменённых файлов: 17 добавлений и 17 удалений

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

@ -180,8 +180,8 @@ int32_t ompi_convertor_pack( ompi_convertor_t* pConv,
{ {
OMPI_CONVERTOR_SET_STATUS_BEFORE_PACK_UNPACK( pConv, iov, out_size, max_data ); OMPI_CONVERTOR_SET_STATUS_BEFORE_PACK_UNPACK( pConv, iov, out_size, max_data );
if( ((pConv->flags & DT_FLAG_BASIC) == DT_FLAG_BASIC) && if( !(pConv->flags & CONVERTOR_WITH_CHECKSUM) &&
!(pConv->flags & CONVERTOR_WITH_CHECKSUM) ) { (pConv->flags & DT_FLAG_NO_GAPS) ) {
/* We are doing conversion on a predefined contiguous datatype. The /* We are doing conversion on a predefined contiguous datatype. The
* convertor contain minimal informations, we only use the bConverted * convertor contain minimal informations, we only use the bConverted
* to manage the conversion. * to manage the conversion.
@ -226,9 +226,9 @@ inline int32_t ompi_convertor_unpack( ompi_convertor_t* pConv,
{ {
OMPI_CONVERTOR_SET_STATUS_BEFORE_PACK_UNPACK( pConv, iov, out_size, max_data ); OMPI_CONVERTOR_SET_STATUS_BEFORE_PACK_UNPACK( pConv, iov, out_size, max_data );
if( ((pConv->flags & (DT_FLAG_BASIC | CONVERTOR_HOMOGENEOUS)) == if( !(pConv->flags & CONVERTOR_WITH_CHECKSUM) &&
(DT_FLAG_BASIC | CONVERTOR_HOMOGENEOUS)) && ((pConv->flags & (CONVERTOR_HOMOGENEOUS | DT_FLAG_NO_GAPS)) ==
!(pConv->flags & CONVERTOR_WITH_CHECKSUM) ) { (CONVERTOR_HOMOGENEOUS | DT_FLAG_NO_GAPS)) ) {
/* We are doing conversion on a contiguous datatype on a homogeneous /* We are doing conversion on a contiguous datatype on a homogeneous
* environment. The convertor contain minimal informations, we only * environment. The convertor contain minimal informations, we only
* use the bConverted to manage the conversion. * use the bConverted to manage the conversion.
@ -426,8 +426,8 @@ int32_t ompi_convertor_set_position_nocheck( ompi_convertor_t* convertor,
assert( NULL != convertor->use_desc->desc ); \ assert( NULL != convertor->use_desc->desc ); \
/* For predefined datatypes (contiguous) do nothing more */ \ /* For predefined datatypes (contiguous) do nothing more */ \
/* if checksum is enabled the always continue */ \ /* if checksum is enabled the always continue */ \
if( ((convertor->flags & DT_FLAG_BASIC) == DT_FLAG_BASIC) && \ if( !(convertor->flags & CONVERTOR_WITH_CHECKSUM) && \
!(convertor->flags & CONVERTOR_WITH_CHECKSUM) && \ (convertor->flags & DT_FLAG_NO_GAPS) && \
((convertor->flags & CONVERTOR_SEND) || \ ((convertor->flags & CONVERTOR_SEND) || \
(convertor->flags & CONVERTOR_HOMOGENEOUS)) ) { \ (convertor->flags & CONVERTOR_HOMOGENEOUS)) ) { \
convertor->bConverted = 0; \ convertor->bConverted = 0; \

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

@ -265,14 +265,14 @@ ompi_convertor_set_position( ompi_convertor_t* convertor,
/* Remove the completed flag if it's already set */ /* Remove the completed flag if it's already set */
convertor->flags &= ~CONVERTOR_COMPLETED; convertor->flags &= ~CONVERTOR_COMPLETED;
if( (convertor->flags & (DT_FLAG_PREDEFINED | CONVERTOR_HOMOGENEOUS)) == if( !(convertor->flags & CONVERTOR_WITH_CHECKSUM) &&
(DT_FLAG_PREDEFINED | CONVERTOR_HOMOGENEOUS) && (convertor->flags & DT_FLAG_NO_GAPS) &&
!(convertor->flags & CONVERTOR_WITH_CHECKSUM) ) { ((convertor->flags & CONVERTOR_SEND) ||
/* basic predefined datatype (contiguous) */ (convertor->flags & CONVERTOR_HOMOGENEOUS)) ) {
/* Contiguous and no checkpoint and no homogeneous unpack */
convertor->bConverted = *position; convertor->bConverted = *position;
return OMPI_SUCCESS; return OMPI_SUCCESS;
} }
return ompi_convertor_set_position_nocheck( convertor, position ); return ompi_convertor_set_position_nocheck( convertor, position );
} }

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

@ -191,9 +191,9 @@ static inline int32_t ompi_ddt_get_size( const ompi_datatype_t* pData, unsigned
static inline int32_t ompi_ddt_is_contiguous_memory_layout( const ompi_datatype_t* datatype, int32_t count ) static inline int32_t ompi_ddt_is_contiguous_memory_layout( const ompi_datatype_t* datatype, int32_t count )
{ {
if( !(datatype->flags & DT_FLAG_CONTIGUOUS) ) return 0; if( !(datatype->flags & DT_FLAG_CONTIGUOUS) ) return 0;
if( count == 1 ) return 1; /* only one data ignore the gaps around */ if( (count == 1) || (datatype->flags & DT_FLAG_NO_GAPS) ) return 1;
if( (long)datatype->size != (datatype->ub - datatype->lb) ) return 0; assert( (long)datatype->size != (datatype->ub - datatype->lb) );
return 1; return 0;
} }
OMPI_DECLSPEC int32_t ompi_ddt_get_element_count( const ompi_datatype_t* pData, int32_t iSize ); OMPI_DECLSPEC int32_t ompi_ddt_get_element_count( const ompi_datatype_t* pData, int32_t iSize );