diff --git a/src/datatype/datatype.h b/src/datatype/datatype.h index 0b05e044e1..78299b1300 100644 --- a/src/datatype/datatype.h +++ b/src/datatype/datatype.h @@ -208,20 +208,19 @@ typedef struct __dt_stack { struct ompi_convertor_t { ompi_object_t super; /**< basic superclass */ - dt_desc_t* pDesc; /**< the datatype description associated with the convertor */ uint32_t remoteArch; /**< the remote architecture */ - uint32_t converted; /**< the number of already converted elements */ - uint32_t bConverted; /**< the size of already converted elements in bytes */ uint32_t flags; /**< the properties of this convertor */ + dt_desc_t* pDesc; /**< the datatype description associated with the convertor */ uint32_t count; /**< the total number of full datatype elements */ - dt_stack_t* pStack; /**< the local stack for the actual conversion */ - uint32_t stack_pos; /**< the actual position on the stack */ - uint32_t stack_size; /**< size of the allocated stack */ char* pBaseBuf; /**< initial buffer as supplied by the user */ - uint32_t available_space; /**< total available space */ + dt_stack_t* pStack; /**< the local stack for the actual conversion */ + uint32_t stack_size; /**< size of the allocated stack */ convertor_advance_fct_t fAdvance; /**< pointer to the pack/unpack functions */ memalloc_fct_t memAlloc_fn; /**< pointer to the memory allocation function */ conversion_fct_t* pFunctions; /**< the convertor functions pointer */ + /* All others fields get modified for every call to pack/unpack functions */ + uint32_t stack_pos; /**< the actual position on the stack */ + uint32_t bConverted; /**< the size of already converted elements in bytes */ dt_stack_t static_stack[DT_STATIC_STACK_SIZE]; /**< local stack to be used for contiguous data */ }; OBJ_CLASS_DECLARATION( ompi_convertor_t ); @@ -309,7 +308,6 @@ static inline int ompi_convertor_copy( const ompi_convertor_t* pSrcConv, ompi_co pDestConv->pStack = pDestConv->static_stack; pDestConv->stack_size = DT_STATIC_STACK_SIZE; pDestConv->stack_pos = 0; - pDestConv->available_space = 0; pDestConv->pFunctions = pSrcConv->pFunctions; return OMPI_SUCCESS; diff --git a/src/datatype/datatype_internal.h b/src/datatype/datatype_internal.h index d21b1bfe6b..a1edf6ddf6 100644 --- a/src/datatype/datatype_internal.h +++ b/src/datatype/datatype_internal.h @@ -368,9 +368,7 @@ int ompi_convertor_create_stack_at_begining( ompi_convertor_t* pConvertor, const } else { ompi_output( 0, "Here we should have a data in the datatype description\n" ); } - /* And set the correct status */ - pConvertor->converted = 0; - pConvertor->bConverted = 0; + pConvertor->bConverted = 0; return OMPI_SUCCESS; } @@ -396,10 +394,7 @@ convertor_init_generic( ompi_convertor_t* pConv, const dt_desc_t* datatype, int } pConv->pBaseBuf = (void*)pUserBuf; - pConv->available_space = count * (datatype->ub - datatype->lb); pConv->count = count; - pConv->converted = 0; - pConv->bConverted = 0; } #if defined(c_plusplus) || defined(__cplusplus) diff --git a/src/datatype/dt_pack.c b/src/datatype/dt_pack.c index c11b41b598..9e01bf8163 100644 --- a/src/datatype/dt_pack.c +++ b/src/datatype/dt_pack.c @@ -127,7 +127,6 @@ int ompi_convertor_pack_general( ompi_convertor_t* pConvertor, printf( "pack there is still room in the input buffer %d bytes\n", iCount ); goto complete_loop; } - pConvertor->converted += rc; /* number of elementd converted so far */ pos_desc++; /* advance to the next data */ count_desc = pElem[pos_desc].count; disp_desc = pElem[pos_desc].disp; diff --git a/src/datatype/dt_unpack.c b/src/datatype/dt_unpack.c index e6139d9330..60401150c6 100644 --- a/src/datatype/dt_unpack.c +++ b/src/datatype/dt_unpack.c @@ -138,7 +138,6 @@ static int ompi_convertor_unpack_general( ompi_convertor_t* pConvertor, printf( "unpack there is still room in the input buffer %d bytes\n", iCount ); goto save_and_return; } - pConvertor->converted += rc; /* number of elements converted so far */ pos_desc++; /* advance to the next data */ count_desc = pElems[pos_desc].count; disp_desc = pElems[pos_desc].disp; diff --git a/src/datatype/fake_stack.c b/src/datatype/fake_stack.c index 1d5865030a..88e5e813b6 100644 --- a/src/datatype/fake_stack.c +++ b/src/datatype/fake_stack.c @@ -82,10 +82,6 @@ int ompi_convertor_create_stack_with_pos_general( ompi_convertor_t* pConvertor, pStack->count = pConvertor->count; pStack->index = -1; if( pConvertor->flags & CONVERTOR_HOMOGENEOUS ) { - if( pData->opt_desc.desc != NULL ) { - pElems = pData->opt_desc.desc; - pStack->end_loop = pData->opt_desc.used; - } loop_length = GET_FIRST_NON_LOOP( pElems ); pStack->disp = pElems[loop_length].disp;