Skip to content

Commit 45336d0

Browse files
committed
libnbc: fix iallgather[v]
In order to optimize for MPI_IN_PLACE, data is sent from the receive buffer. consequently, it should be sent with the receive type and count. Thanks Josh Hursey for the report and test case Refs #2256
1 parent 2d94845 commit 45336d0

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

ompi/mca/coll/libnbc/nbc_iallgather.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Corporation. All rights reserved.
66
* Copyright (c) 2006 The Technical University of Chemnitz. All
77
* rights reserved.
8-
* Copyright (c) 2014-2015 Research Organization for Information Science
8+
* Copyright (c) 2014-2016 Research Organization for Information Science
99
* and Technology (RIST). All rights reserved.
1010
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
1111
* reserved.
@@ -104,7 +104,7 @@ int ompi_coll_libnbc_iallgather(const void* sendbuf, int sendcount, MPI_Datatype
104104
}
105105

106106
/* send to rank r - not from the sendbuf to optimize MPI_IN_PLACE */
107-
res = NBC_Sched_send (sbuf, false, sendcount, sendtype, r, schedule, false);
107+
res = NBC_Sched_send (sbuf, false, recvcount, recvtype, r, schedule, false);
108108
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
109109
OBJ_RELEASE(schedule);
110110
return res;

ompi/mca/coll/libnbc/nbc_iallgatherv.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
1212
* Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights
1313
* reserved.
14-
* Copyright (c) 2014-2015 Research Organization for Information Science
14+
* Copyright (c) 2014-2016 Research Organization for Information Science
1515
* and Technology (RIST). All rights reserved.
1616
*
1717
*/
@@ -82,7 +82,8 @@ int ompi_coll_libnbc_iallgatherv(const void* sendbuf, int sendcount, MPI_Datatyp
8282
return res;
8383
}
8484

85-
res = NBC_Sched_send (sbuf, false, sendcount, sendtype, speer, schedule, false);
85+
/* send to rank r - not from the sendbuf to optimize MPI_IN_PLACE */
86+
res = NBC_Sched_send (sbuf, false, recvcounts[rank], recvtype, speer, schedule, false);
8687
if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) {
8788
OBJ_RELEASE(schedule);
8889
return res;

0 commit comments

Comments
 (0)