From f648f0bb51f69b1e13463641f0783bbc12ba3c7e Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Tue, 13 Jun 2006 19:24:29 +0000 Subject: [PATCH] If the convertor have the checksum flag don't try to be nice and optimize. Just do it in a way that will allow the checksum computation in all the cases. This commit was SVN r10336. --- ompi/datatype/convertor.c | 10 +++++++--- ompi/datatype/convertor.h | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ompi/datatype/convertor.c b/ompi/datatype/convertor.c index 519a4b63f0..3e118c040e 100644 --- a/ompi/datatype/convertor.c +++ b/ompi/datatype/convertor.c @@ -180,7 +180,8 @@ 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 & DT_FLAG_BASIC) == DT_FLAG_BASIC) { + if( ((pConv->flags & DT_FLAG_BASIC) == DT_FLAG_BASIC) && + !(pConv->flags & CONVERTOR_WITH_CHECKSUM) ) { /* We are doing conversion on a predefined contiguous datatype. The * convertor contain minimal informations, we only use the bConverted * to manage the conversion. @@ -230,8 +231,9 @@ inline 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 & (DT_FLAG_BASIC | CONVERTOR_HOMOGENEOUS)) == - (DT_FLAG_BASIC | CONVERTOR_HOMOGENEOUS) ) { + if( ((pConv->flags & (DT_FLAG_BASIC | CONVERTOR_HOMOGENEOUS)) == + (DT_FLAG_BASIC | CONVERTOR_HOMOGENEOUS)) && + !(pConv->flags & CONVERTOR_WITH_CHECKSUM) ) { /* 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. @@ -422,7 +424,9 @@ 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 the always continue */ \ if( ((convertor->flags & DT_FLAG_BASIC) == DT_FLAG_BASIC) && \ + !(convertor->flags & CONVERTOR_WITH_CHECKSUM) && \ ((convertor->flags & CONVERTOR_SEND) || \ (convertor->flags & CONVERTOR_HOMOGENEOUS) ) ) { \ convertor->bConverted = 0; \ diff --git a/ompi/datatype/convertor.h b/ompi/datatype/convertor.h index 8f1b5395e4..ad4a74ff5b 100644 --- a/ompi/datatype/convertor.h +++ b/ompi/datatype/convertor.h @@ -267,7 +267,8 @@ ompi_convertor_set_position( ompi_convertor_t* convertor, convertor->flags &= ~CONVERTOR_COMPLETED; if( (convertor->flags & (DT_FLAG_PREDEFINED | CONVERTOR_HOMOGENEOUS)) == - (DT_FLAG_PREDEFINED | CONVERTOR_HOMOGENEOUS) ) { + (DT_FLAG_PREDEFINED | CONVERTOR_HOMOGENEOUS) && + !(convertor->flags & CONVERTOR_WITH_CHECKSUM) ) { /* basic predefined datatype (contiguous) */ convertor->bConverted = *position; return OMPI_SUCCESS;