Skip to content

Commit 1462363

Browse files
authored
Merge pull request #54 from devreal/fix-han-scatter-inplace
COLL HAN: use correct type/count in scatter for MPI_IN_PLACE
2 parents 12d771c + 7b231b3 commit 1462363

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

ompi/mca/coll/han/coll_han_scatter.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,21 @@ mca_coll_han_scatter_intra(const void *sbuf, int scount,
159159
}
160160

161161

162-
void *dest_buf = (MPI_IN_PLACE == rbuf) ? (void*)sbuf : rbuf;
162+
void *dest_buf = rbuf;
163+
int dest_count = rcount;
164+
ompi_datatype_t *dest_dtype = rdtype;
165+
if (MPI_IN_PLACE == rbuf) {
166+
dest_buf = (void*)sbuf;
167+
dest_count = scount;
168+
dest_dtype = sdtype;
169+
}
163170

164171
/* Create us task */
165172
mca_coll_task_t *us = OBJ_NEW(mca_coll_task_t);
166173
/* Setup us task arguments */
167174
mca_coll_han_scatter_args_t *us_args = malloc(sizeof(mca_coll_han_scatter_args_t));
168175
mca_coll_han_set_scatter_args(us_args, us, reorder_sbuf, NULL, reorder_buf, scount, sdtype,
169-
(char *) dest_buf, rcount, rdtype, root, root_up_rank, root_low_rank,
176+
(char *) dest_buf, dest_count, dest_dtype, root, root_up_rank, root_low_rank,
170177
up_comm, low_comm, w_rank, low_rank != root_low_rank,
171178
temp_request);
172179
/* Init us task */

0 commit comments

Comments
 (0)