Skip to content

Commit 53e5fba

Browse files
committed
SQUASHME: fixes for hvector
Signed-off-by: Joseph Schuchart <[email protected]>
1 parent 74a8851 commit 53e5fba

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

ompi/datatype/ompi_datatype_args.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ int32_t ompi_datatype_set_args( ompi_datatype_t* pData,
156156
case MPI_COMBINER_HVECTOR:
157157
copy_count_array(1, &pi, &pl, counts[0]);
158158
copy_count_array(1, &pi, &pl, counts[1]);
159+
if (cl > 0) {
160+
// copy the stride
161+
memcpy(pl, opal_count_array_ptr(counts[2]), sizeof(MPI_Count));
162+
pl++;
163+
}
159164
break;
160165

161166
case MPI_COMBINER_INDEXED: {

ompi/mpi/c/type_create_hvector.c.in

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,20 @@ PROTOTYPE ERROR_CLASS type_create_hvector(COUNT count,
6565
OMPI_ERRHANDLER_NOHANDLE_CHECK(rc, rc, FUNC_NAME );
6666

6767
{
68-
ompi_count_array_t a_i[2] = {OMPI_COUNT_ARRAY_CREATE(&count), OMPI_COUNT_ARRAY_CREATE(&blocklength)};
69-
ompi_disp_array_t a_a = OMPI_DISP_ARRAY_CREATE(&stride);
68+
#if OMPI_BIGCOUNT_SRC
69+
ompi_count_array_t a_i[3] = {OMPI_COUNT_ARRAY_CREATE(&count),
70+
OMPI_COUNT_ARRAY_CREATE(&blocklength),
71+
OMPI_COUNT_ARRAY_CREATE(&stride)};
7072

71-
ompi_datatype_set_args( *newtype,
72-
(sizeof(count) != sizeof(size_t)) ? 2 : 0,
73-
(sizeof(count) == sizeof(size_t)) ? 2 : 0,
74-
a_i, 1, a_a, 1, &oldtype, MPI_COMBINER_HVECTOR );
73+
ompi_datatype_set_args( *newtype, 0, 3,
74+
a_i, 0, OMPI_DISP_ARRAY_NULL, 1, &oldtype, MPI_COMBINER_HVECTOR );
75+
#else
76+
const ompi_count_array_t a_i[2] = {OMPI_COUNT_ARRAY_CREATE(&count),
77+
OMPI_COUNT_ARRAY_CREATE(&blocklength)};
78+
79+
ompi_datatype_set_args( *newtype, 2, 0,
80+
a_i, 1, OMPI_DISP_ARRAY_CREATE(&stride), 1, &oldtype, MPI_COMBINER_HVECTOR );
81+
#endif
7582
}
7683

7784
return MPI_SUCCESS;

0 commit comments

Comments
 (0)