From 24099edb3840ba8cec75cd6e4a554d053db365e3 Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Wed, 14 Jun 2006 03:17:32 +0000 Subject: [PATCH] Make sure the partial_length has the expected value. This commit was SVN r10346. --- ompi/datatype/convertor.c | 1 + ompi/datatype/position.c | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ompi/datatype/convertor.c b/ompi/datatype/convertor.c index 3e118c040e..c09f75d5f9 100644 --- a/ompi/datatype/convertor.c +++ b/ompi/datatype/convertor.c @@ -310,6 +310,7 @@ int ompi_convertor_create_stack_with_pos_contig( ompi_convertor_t* pConvertor, pConvertor->bConverted = starting_point; pConvertor->stack_pos = 1; + assert( 0 == pConvertor->partial_length ); return OMPI_SUCCESS; } diff --git a/ompi/datatype/position.c b/ompi/datatype/position.c index 7e6c520d17..5309c1a948 100644 --- a/ompi/datatype/position.c +++ b/ompi/datatype/position.c @@ -146,6 +146,7 @@ int ompi_convertor_generic_simple_position( ompi_convertor_t* pConvertor, if( --(pStack->count) == 0 ) { /* end of loop */ if( pConvertor->stack_pos == 0 ) { pConvertor->flags |= CONVERTOR_COMPLETED; + pConvertor->partial_length = 0; goto complete_loop; /* completed */ } pConvertor->stack_pos--; @@ -191,6 +192,7 @@ int ompi_convertor_generic_simple_position( ompi_convertor_t* pConvertor, base_pointer, iov_len_local ); if( 0 != count_desc ) { /* completed */ type = pElem->elem.common.type; + pConvertor->partial_length = iov_len_local; goto complete_loop; } base_pointer = pConvertor->pBaseBuf + pStack->disp; @@ -199,11 +201,6 @@ int ompi_convertor_generic_simple_position( ompi_convertor_t* pConvertor, } } complete_loop: - if( 0 != pConvertor->partial_length ) - assert( iov_len_local == pConvertor->partial_length ); - pConvertor->partial_length = iov_len_local; - - (*position) -= iov_len_local; pConvertor->bConverted = *position; /* update the already converted bytes */ if( !(pConvertor->flags & CONVERTOR_COMPLETED) ) {