Skip to content

Commit e1b06bc

Browse files
committed
Correctly compute the dispacement for block indexed types.
Signed-off-by: George Bosilca <[email protected]>
1 parent 1e30cca commit e1b06bc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ompi/datatype/ompi_datatype_create_indexed.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,17 +162,17 @@ int32_t ompi_datatype_create_hindexed_block( int count, int bLength, const ptrdi
162162
pdt = ompi_datatype_create( count * (2 + oldType->super.desc.used) );
163163
disp = pDisp[0];
164164
dLength = bLength;
165-
endat = disp + dLength;
165+
endat = disp + dLength * extent;
166166
for( i = 1; i < count; i++ ) {
167167
if( endat == pDisp[i] ) {
168168
/* contiguous with the previsious */
169169
dLength += bLength;
170-
endat += bLength;
170+
endat += bLength * extent;
171171
} else {
172172
ompi_datatype_add( pdt, oldType, dLength, disp, extent );
173173
disp = pDisp[i];
174174
dLength = bLength;
175-
endat = disp + bLength;
175+
endat = disp + bLength * extent;
176176
}
177177
}
178178
ompi_datatype_add( pdt, oldType, dLength, disp, extent );

0 commit comments

Comments
 (0)