diff --git a/ompi/datatype/convertor.c b/ompi/datatype/convertor.c index 2243967fe3..4fc879f96f 100644 --- a/ompi/datatype/convertor.c +++ b/ompi/datatype/convertor.c @@ -91,6 +91,7 @@ inline int32_t ompi_convertor_pack( ompi_convertor_t* pConv, struct iovec* iov, uint32_t* out_size, size_t* max_data, int32_t* freeAfter ) { + pConv->checksum = 0; /* protect against over packing data */ if( pConv->bConverted == (pConv->pDesc->size * pConv->count) ) { iov[0].iov_len = 0; @@ -112,6 +113,7 @@ inline int32_t ompi_convertor_unpack( ompi_convertor_t* pConv, { const ompi_datatype_t *pData = pConv->pDesc; + pConv->checksum = 0; /* protect against over unpacking data */ if( pConv->bConverted == (pData->size * pConv->count) ) { iov[0].iov_len = 0; @@ -176,7 +178,8 @@ int ompi_convertor_create_stack_with_pos_contig( ompi_convertor_t* pConvertor, } static inline -int ompi_convertor_create_stack_at_begining( ompi_convertor_t* pConvertor, const int* sizes ) +int ompi_convertor_create_stack_at_begining( ompi_convertor_t* pConvertor, + const int* sizes ) { dt_stack_t* pStack = pConvertor->pStack; dt_elem_desc_t* pElems; diff --git a/ompi/datatype/convertor.h b/ompi/datatype/convertor.h index 37c9915463..4c93b662c2 100644 --- a/ompi/datatype/convertor.h +++ b/ompi/datatype/convertor.h @@ -52,6 +52,7 @@ struct ompi_datatype_t; #define CONVERTOR_STATE_COMPLETE 0x02000000 #define CONVERTOR_STATE_ALLOC 0x04000000 #define CONVERTOR_COMPLETED 0x08000000 +#define CONVERTOR_COMPUTE_CRC 0x10000000 typedef int32_t (*conversion_fct_t)( uint32_t count, const void* from, uint32_t from_len, long from_extent, @@ -92,6 +93,7 @@ struct ompi_convertor_t { /* All others fields get modified for every call to pack/unpack functions */ uint32_t stack_pos; /**< the actual position on the stack */ size_t bConverted; /**< # of bytes already converted */ + uint32_t checksum; /**< checksum computed by pack/unpack operation */ char pending[16]; /**< bytes pending from the last conversion */ uint32_t pending_length; /**< # bytes pending ... */ dt_stack_t static_stack[DT_STATIC_STACK_SIZE]; /**< local stack for small datatypes */ @@ -105,6 +107,15 @@ OMPI_DECLSPEC extern uint32_t ompi_mpi_local_arch; extern conversion_fct_t ompi_ddt_copy_functions[]; +/* + * + */ +static inline uint32_t +ompi_convertor_get_checksum( ompi_convertor_t* convertor ) +{ + return convertor->checksum; +} + /* * */