1
1

For contiguous and contiguous with gaps types we should take in account the true_lb

when we pack/unpack.

This commit was SVN r10308.
Этот коммит содержится в:
George Bosilca 2006-06-12 16:53:23 +00:00
родитель 18dda70fd0
Коммит 00e611784b
3 изменённых файлов: 7 добавлений и 8 удалений

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

@ -193,7 +193,7 @@ int32_t ompi_convertor_pack( ompi_convertor_t* pConv,
pending_length = (*max_data);
for( i = 0; (i < *out_size) && (0 != pending_length); i++ ) {
base_pointer = pConv->pBaseBuf + pConv->bConverted;
base_pointer = pConv->pBaseBuf + pConv->bConverted + pConv->pDesc->true_lb;
if( iov[i].iov_len > pending_length )
iov[i].iov_len = pending_length;
@ -240,7 +240,7 @@ inline int32_t ompi_convertor_unpack( ompi_convertor_t* pConv,
*max_data = pConv->bConverted;
for( i = 0; i < *out_size; i++ ) {
base_pointer = pConv->pBaseBuf + pConv->bConverted;
base_pointer = pConv->pBaseBuf + pConv->bConverted + pConv->pDesc->true_lb;
pConv->bConverted += iov[i].iov_len;
if( pConv->bConverted >= pConv->local_size ) {
pConv->bConverted = pConv->local_size;

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

@ -671,13 +671,12 @@ ompi_pack_homogeneous_contig_with_gaps_function( ompi_convertor_t* pConv,
max_allowed = (*max_data);
i = pConv->bConverted / pData->size; /* how many we already pack */
user_memory = pConv->pBaseBuf + pStack->disp; /* actual starting point for the conversion */
*freeAfter = 0;
/* There are some optimizations that can be done if the upper level
* does not provide a buffer.
*/
user_memory = pConv->pBaseBuf + pStack[0].disp + pStack[1].disp;
user_memory = pConv->pBaseBuf + pData->true_lb + pStack[0].disp + pStack[1].disp;
for( iov_count = 0; iov_count < (*out_size); iov_count++ ) {
if( 0 == max_allowed ) break; /* we're done this time */
if( iov[iov_count].iov_base == NULL ) {
@ -713,7 +712,6 @@ ompi_pack_homogeneous_contig_with_gaps_function( ompi_convertor_t* pConv,
iov[index].iov_base = user_memory;
iov[index].iov_len = max_allowed;
max_allowed = 0;
printf( "%s:%d Possible problem here\n", __FILE__, __LINE__ );
COMPUTE_CSUM( iov[index].iov_base, iov[index].iov_len, pConv );
break;
} else {
@ -762,7 +760,7 @@ ompi_pack_homogeneous_contig_with_gaps_function( ompi_convertor_t* pConv,
i++; /* just to compute the correct source pointer */
total_bytes_converted += done;
}
user_memory = pConv->pBaseBuf + i * extent;
user_memory = pConv->pBaseBuf + pData->true_lb + i * extent;
counter = max_allowed / pData->size;
if( counter > pConv->count ) counter = pConv->count;
for( i = 0; i < counter; i++ ) {
@ -779,7 +777,7 @@ ompi_pack_homogeneous_contig_with_gaps_function( ompi_convertor_t* pConv,
* the pStack[0].disp field. BEWARE here we remove the pStack[1].disp as
* it's supposed to be useless from now.
*/
user_memory = pConv->pBaseBuf + pStack[0].disp;
user_memory = pConv->pBaseBuf + pData->true_lb + pStack[0].disp;
}
*max_data = total_bytes_converted;
pConv->bConverted += total_bytes_converted;

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

@ -184,6 +184,7 @@ ompi_unpack_homogeneous_contig_function( ompi_convertor_t* pConv,
long extent = pData->ub - pData->lb;
uint32_t bConverted, length, remaining, i;
dt_stack_t* stack = &(pConv->pStack[1]);
ddt_endloop_desc_t* _end_loop = &(pConv->use_desc->desc[pConv->use_desc->used].end_loop);
for( iov_count = 0; iov_count < (*out_size); iov_count++ ) {
packed_buffer = (char*)iov[iov_count].iov_base;
@ -191,7 +192,7 @@ ompi_unpack_homogeneous_contig_function( ompi_convertor_t* pConv,
if( remaining > (uint32_t)iov[iov_count].iov_len )
remaining = iov[iov_count].iov_len;
bConverted = remaining; /* how much will get unpacked this time */
user_memory = pConv->pBaseBuf;
user_memory = pConv->pBaseBuf + _end_loop->first_elem_disp;
/*opal_output( 0, "unpack_homogeneous_contig( user_memory %p, packed_buffer %p length %d\n",
user_memory, packed_buffer, remaining );*/