Skip to content

Commit 6f7e9bc

Browse files
authored
Merge pull request #10329 from Akshay-Venkatesh/topic/reduce-non-root-ignore-rbuf-main
Ignore receive buffer at non-root for cuda reduce collective
2 parents 1cedafb + 8d9e60f commit 6f7e9bc

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) && (opal_cuda_check_bufs((char *)rbuf, NULL))) {
5859
rbuf1 = (char*)malloc(bufsize);
5960
if (NULL == rbuf1) {
6061
if (NULL != sbuf1) free(sbuf1);

0 commit comments

Comments
 (0)