1
1

Rewrite the conditions to keep them as small as possible. Correct some

of these conditions. Optimize the flags generation for the convertor.

This commit was SVN r12518.
Этот коммит содержится в:
George Bosilca 2006-11-09 19:33:19 +00:00
родитель da1720d1ef
Коммит e33d1dedab
2 изменённых файлов: 19 добавлений и 18 удалений

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

@ -229,8 +229,7 @@ int32_t ompi_convertor_pack( ompi_convertor_t* pConv,
{
OMPI_CONVERTOR_SET_STATUS_BEFORE_PACK_UNPACK( pConv, iov, out_size, max_data );
if( !(pConv->flags & CONVERTOR_WITH_CHECKSUM) &&
(pConv->flags & DT_FLAG_NO_GAPS) ) {
if( pConv->flags & CONVERTOR_NO_OP ) {
/* We are doing conversion on a contiguous datatype on a homogeneous
* environment. The convertor contain minimal informations, we only
* use the bConverted to manage the conversion.
@ -277,9 +276,7 @@ int32_t ompi_convertor_unpack( ompi_convertor_t* pConv,
{
OMPI_CONVERTOR_SET_STATUS_BEFORE_PACK_UNPACK( pConv, iov, out_size, max_data );
if( !(pConv->flags & CONVERTOR_WITH_CHECKSUM) &&
((pConv->flags & (CONVERTOR_HOMOGENEOUS | DT_FLAG_NO_GAPS)) ==
(CONVERTOR_HOMOGENEOUS | DT_FLAG_NO_GAPS)) ) {
if( pConv->flags & CONVERTOR_NO_OP ) {
/* We are doing conversion on a contiguous datatype on a homogeneous
* environment. The convertor contain minimal informations, we only
* use the bConverted to manage the conversion.
@ -450,10 +447,10 @@ int32_t ompi_convertor_set_position_nocheck( ompi_convertor_t* convertor,
assert( NULL != convertor->use_desc->desc ); \
/* For predefined datatypes (contiguous) do nothing more */ \
/* if checksum is enabled then always continue */ \
if( !(convertor->flags & CONVERTOR_WITH_CHECKSUM) && \
(convertor->flags & DT_FLAG_NO_GAPS) && \
((convertor->flags & CONVERTOR_SEND) || \
(convertor->flags & CONVERTOR_HOMOGENEOUS)) ) { \
if( ((convertor->flags & (CONVERTOR_WITH_CHECKSUM | DT_FLAG_NO_GAPS)) \
== DT_FLAG_NO_GAPS) && \
(convertor->flags & (CONVERTOR_SEND | CONVERTOR_HOMOGENEOUS)) ) { \
convertor->flags |= CONVERTOR_NO_OP; \
return OMPI_SUCCESS; \
} \
{ \
@ -479,7 +476,7 @@ ompi_convertor_prepare_for_recv( ompi_convertor_t* convertor,
{
/* Here I should check that the data is not overlapping */
convertor->flags |= CONVERTOR_RECV;
convertor->flags |= CONVERTOR_RECV;
OMPI_CONVERTOR_PREPARE_INTERNAL( convertor, datatype, count, pUserBuf );
@ -515,7 +512,7 @@ ompi_convertor_prepare_for_send( ompi_convertor_t* convertor,
int32_t count,
const void* pUserBuf )
{
convertor->flags |= CONVERTOR_SEND;
convertor->flags |= CONVERTOR_SEND;
OMPI_CONVERTOR_PREPARE_INTERNAL( convertor, datatype, count, pUserBuf );

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

@ -162,10 +162,9 @@ static inline int ompi_convertor_cleanup( ompi_convertor_t* convertor )
static inline int32_t
ompi_convertor_need_buffers( const ompi_convertor_t* pConvertor )
{
if( (pConvertor->count == 1) && (pConvertor->flags & DT_FLAG_NO_GAPS) ) return 0;
if( pConvertor->flags & DT_FLAG_CONTIGUOUS ) return 0;
if( pConvertor->flags & DT_FLAG_NO_GAPS ) return 0;
if( (pConvertor->count == 1) && (pConvertor->flags & DT_FLAG_CONTIGUOUS) ) return 0;
return 1;
/*return !ompi_ddt_is_contiguous_memory_layout( pConvertor->pDesc, pConvertor->count );*/
}
/*
@ -213,19 +212,24 @@ ompi_convertor_get_unpacked_size( const ompi_convertor_t* pConv,
* the convertor->local_size but we can test the 2 components. \
*/ \
if( 0 == (convertor->count | datatype->size) ) { \
convertor->flags |= (CONVERTOR_COMPLETED | DT_FLAG_CONTIGUOUS | CONVERTOR_NO_OP); \
convertor->flags |= (CONVERTOR_COMPLETED | CONVERTOR_NO_OP); \
convertor->remote_size = 0; \
return OMPI_SUCCESS; \
} \
\
convertor->flags |= CONVERTOR_HOMOGENEOUS; \
if( convertor->remoteArch == ompi_mpi_local_arch ) { \
convertor->remote_size = convertor->local_size; \
convertor->use_desc = &(datatype->opt_desc); \
if( (convertor->flags & (CONVERTOR_WITH_CHECKSUM | DT_FLAG_CONTIGUOUS)) == DT_FLAG_CONTIGUOUS ) { \
convertor->flags |= CONVERTOR_NO_OP; \
if( (convertor->flags & (CONVERTOR_WITH_CHECKSUM | DT_FLAG_NO_GAPS)) == DT_FLAG_NO_GAPS ) { \
convertor->flags |= (CONVERTOR_NO_OP | CONVERTOR_HOMOGENEOUS); \
return OMPI_SUCCESS; \
} \
if( ((convertor->flags & (CONVERTOR_WITH_CHECKSUM | DT_FLAG_CONTIGUOUS)) \
== DT_FLAG_CONTIGUOUS) && (1 == count) ) { \
convertor->flags |= (CONVERTOR_NO_OP | CONVERTOR_HOMOGENEOUS); \
return OMPI_SUCCESS; \
} \
convertor->flags |= CONVERTOR_HOMOGENEOUS; \
} \
}