Skip to content

Commit daf4338

Browse files
committed
Fix the stack displacement.
Fixes the convertor iovec description on the MPI-IO reported by Edgar. Signed-off-by: George Bosilca <[email protected]>
1 parent d58c59e commit daf4338

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

opal/datatype/opal_convertor_raw.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ opal_convertor_raw( opal_convertor_t* pConvertor,
126126
const ddt_elem_desc_t* current = &(pElem->elem);
127127

128128
if( count_desc != (current->count * current->blocklen) ) { /* Not the full element description */
129-
do_now = current->blocklen - (count_desc % current->blocklen); /* how much left in the block */
130-
if( do_now ) {
129+
if( (do_now = count_desc % current->blocklen) ) {
130+
do_now = current->blocklen - do_now; /* how much left in the block */
131131
source_base += current->disp;
132132
blength = do_now * opal_datatype_basicDatatypes[current->common.type]->size;
133133
OPAL_DATATYPE_SAFEGUARD_POINTER( source_base, blength, pConvertor->pBaseBuf,
@@ -136,12 +136,12 @@ opal_convertor_raw( opal_convertor_t* pConvertor,
136136
index, (void*)source_base, blength ); );
137137
opal_convertor_merge_iov( iov, iov_count,
138138
(IOVBASE_TYPE *) source_base, blength, &index );
139-
/* not check the return value, we know there was at least one element in the iovec */
139+
/* ignore the return value, we know there was at least one element in the iovec */
140140
sum_iov_len += blength;
141141
count_desc -= do_now;
142142

143-
source_base += (current->extent - current->disp +
144-
(current->blocklen - do_now) * opal_datatype_basicDatatypes[current->common.type]->size);
143+
source_base += (blength - current->blocklen * opal_datatype_basicDatatypes[current->common.type]->size +
144+
current->extent - current->disp);
145145
}
146146
}
147147
}
@@ -258,7 +258,7 @@ opal_convertor_raw( opal_convertor_t* pConvertor,
258258
}
259259
/* I complete an element, next step I should go to the next one */
260260
PUSH_STACK( pStack, pConvertor->stack_pos, pos_desc, OPAL_DATATYPE_UINT1, count_desc,
261-
source_base - pStack->disp - pConvertor->pBaseBuf );
261+
source_base - pConvertor->pBaseBuf );
262262
DO_DEBUG( opal_output( 0, "raw save stack stack_pos %d pos_desc %d count_desc %" PRIsize_t " disp %ld\n",
263263
pConvertor->stack_pos, pStack->index, pStack->count, (long)pStack->disp ); );
264264
return 0;

0 commit comments

Comments
 (0)