For contiguous and contiguous with gaps types we should take in account the true_lb
when we pack/unpack. This commit was SVN r10308.
Этот коммит содержится в:
родитель
18dda70fd0
Коммит
00e611784b
@ -193,7 +193,7 @@ int32_t ompi_convertor_pack( ompi_convertor_t* pConv,
|
|||||||
pending_length = (*max_data);
|
pending_length = (*max_data);
|
||||||
|
|
||||||
for( i = 0; (i < *out_size) && (0 != pending_length); i++ ) {
|
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 )
|
if( iov[i].iov_len > pending_length )
|
||||||
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;
|
*max_data = pConv->bConverted;
|
||||||
for( i = 0; i < *out_size; i++ ) {
|
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;
|
pConv->bConverted += iov[i].iov_len;
|
||||||
if( pConv->bConverted >= pConv->local_size ) {
|
if( pConv->bConverted >= pConv->local_size ) {
|
||||||
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);
|
max_allowed = (*max_data);
|
||||||
|
|
||||||
i = pConv->bConverted / pData->size; /* how many we already pack */
|
i = pConv->bConverted / pData->size; /* how many we already pack */
|
||||||
user_memory = pConv->pBaseBuf + pStack->disp; /* actual starting point for the conversion */
|
|
||||||
|
|
||||||
*freeAfter = 0;
|
*freeAfter = 0;
|
||||||
/* There are some optimizations that can be done if the upper level
|
/* There are some optimizations that can be done if the upper level
|
||||||
* does not provide a buffer.
|
* 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++ ) {
|
for( iov_count = 0; iov_count < (*out_size); iov_count++ ) {
|
||||||
if( 0 == max_allowed ) break; /* we're done this time */
|
if( 0 == max_allowed ) break; /* we're done this time */
|
||||||
if( iov[iov_count].iov_base == NULL ) {
|
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_base = user_memory;
|
||||||
iov[index].iov_len = max_allowed;
|
iov[index].iov_len = max_allowed;
|
||||||
max_allowed = 0;
|
max_allowed = 0;
|
||||||
printf( "%s:%d Possible problem here\n", __FILE__, __LINE__ );
|
|
||||||
COMPUTE_CSUM( iov[index].iov_base, iov[index].iov_len, pConv );
|
COMPUTE_CSUM( iov[index].iov_base, iov[index].iov_len, pConv );
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
@ -762,7 +760,7 @@ ompi_pack_homogeneous_contig_with_gaps_function( ompi_convertor_t* pConv,
|
|||||||
i++; /* just to compute the correct source pointer */
|
i++; /* just to compute the correct source pointer */
|
||||||
total_bytes_converted += done;
|
total_bytes_converted += done;
|
||||||
}
|
}
|
||||||
user_memory = pConv->pBaseBuf + i * extent;
|
user_memory = pConv->pBaseBuf + pData->true_lb + i * extent;
|
||||||
counter = max_allowed / pData->size;
|
counter = max_allowed / pData->size;
|
||||||
if( counter > pConv->count ) counter = pConv->count;
|
if( counter > pConv->count ) counter = pConv->count;
|
||||||
for( i = 0; i < counter; i++ ) {
|
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
|
* the pStack[0].disp field. BEWARE here we remove the pStack[1].disp as
|
||||||
* it's supposed to be useless from now.
|
* 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;
|
*max_data = total_bytes_converted;
|
||||||
pConv->bConverted += 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;
|
long extent = pData->ub - pData->lb;
|
||||||
uint32_t bConverted, length, remaining, i;
|
uint32_t bConverted, length, remaining, i;
|
||||||
dt_stack_t* stack = &(pConv->pStack[1]);
|
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++ ) {
|
for( iov_count = 0; iov_count < (*out_size); iov_count++ ) {
|
||||||
packed_buffer = (char*)iov[iov_count].iov_base;
|
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 )
|
if( remaining > (uint32_t)iov[iov_count].iov_len )
|
||||||
remaining = iov[iov_count].iov_len;
|
remaining = iov[iov_count].iov_len;
|
||||||
bConverted = remaining; /* how much will get unpacked this time */
|
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",
|
/*opal_output( 0, "unpack_homogeneous_contig( user_memory %p, packed_buffer %p length %d\n",
|
||||||
user_memory, packed_buffer, remaining );*/
|
user_memory, packed_buffer, remaining );*/
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user