Skip to content

Commit 7cc326b

Browse files
Ignore receive buffer at non-root for cuda reduce collective
Signed-off-by: Akshay Venkatesh <akshay.v.3.14@gmail.com>
1 parent c52ab16 commit 7cc326b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ompi/mca/coll/cuda/coll_cuda_reduce.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ mca_coll_cuda_reduce(const void *sbuf, void *rbuf, int count,
3535
mca_coll_base_module_t *module)
3636
{
3737
mca_coll_cuda_module_t *s = (mca_coll_cuda_module_t*) module;
38+
int rank = ompi_comm_rank(comm);
3839
ptrdiff_t gap;
3940
char *rbuf1 = NULL, *sbuf1 = NULL, *rbuf2 = NULL;
4041
const char *sbuf2;
@@ -54,7 +55,7 @@ mca_coll_cuda_reduce(const void *sbuf, void *rbuf, int count,
5455
sbuf = sbuf1 - gap;
5556
}
5657

57-
if (opal_cuda_check_bufs(rbuf, NULL)) {
58+
if (rank == root) {
5859
rbuf1 = (char*)malloc(bufsize);
5960
if (NULL == rbuf1) {
6061
if (NULL != sbuf1) free(sbuf1);

0 commit comments

Comments
 (0)