Skip to content

Commit f03693e

Browse files
committed
Fix offsets in datatype pack
Signed-off-by: Joseph Schuchart <[email protected]>
1 parent de67a73 commit f03693e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ompi/datatype/ompi_datatype_args.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ int32_t ompi_datatype_set_args( ompi_datatype_t* pData,
132132
}
133133

134134
pArgs->ref_count = 1;
135-
pArgs->total_pack_size = 4 * sizeof(int) + ci * sizeof(int) +
135+
pArgs->total_pack_size = 5 * sizeof(size_t) + ci * sizeof(int) +
136136
cl * sizeof(size_t) +
137137
cd * sizeof(MPI_Datatype) +
138138
ca * sizeof(ptrdiff_t);
@@ -666,6 +666,7 @@ static ompi_datatype_t* __ompi_datatype_create_from_packed_description( void** p
666666
/* the array of lengths (32 bits aligned) */
667667
if (number_of_ints > 0) {
668668
array_of_ints = (int*)next_buffer;
669+
next_buffer += number_of_ints * sizeof(int);
669670
}
670671

671672
for( i = 0; i < number_of_datatype; i++ ) {
@@ -847,7 +848,7 @@ static ompi_datatype_t* __ompi_datatype_create_from_args( const int* i, const si
847848
cl = count+1;
848849
}
849850
ompi_datatype_create_hindexed( count, a_i[1], disp_array, d[0], &datatype );
850-
ompi_datatype_set_args( datatype, cl, ci, a_i, count, disp_array, 1, d, MPI_COMBINER_HINDEXED );
851+
ompi_datatype_set_args( datatype, ci, cl, a_i, count, disp_array, 1, d, MPI_COMBINER_HINDEXED );
851852
}
852853
break;
853854
/******************************************************************/

0 commit comments

Comments
 (0)