From 45336d0bead7dfaba8d0c41196925f6086eb3309 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Fri, 21 Oct 2016 10:20:43 +0900 Subject: [PATCH] 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 open-mpi/ompi#2256 --- ompi/mca/coll/libnbc/nbc_iallgather.c | 4 ++-- ompi/mca/coll/libnbc/nbc_iallgatherv.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ompi/mca/coll/libnbc/nbc_iallgather.c b/ompi/mca/coll/libnbc/nbc_iallgather.c index 60180d1419..9f0fea3706 100644 --- a/ompi/mca/coll/libnbc/nbc_iallgather.c +++ b/ompi/mca/coll/libnbc/nbc_iallgather.c @@ -5,7 +5,7 @@ * Corporation. All rights reserved. * Copyright (c) 2006 The Technical University of Chemnitz. All * rights reserved. - * Copyright (c) 2014-2015 Research Organization for Information Science + * Copyright (c) 2014-2016 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. @@ -104,7 +104,7 @@ int ompi_coll_libnbc_iallgather(const void* sendbuf, int sendcount, MPI_Datatype } /* send to rank r - not from the sendbuf to optimize MPI_IN_PLACE */ - res = NBC_Sched_send (sbuf, false, sendcount, sendtype, r, schedule, false); + res = NBC_Sched_send (sbuf, false, recvcount, recvtype, r, schedule, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res; diff --git a/ompi/mca/coll/libnbc/nbc_iallgatherv.c b/ompi/mca/coll/libnbc/nbc_iallgatherv.c index a8a77dc893..ea3c363440 100644 --- a/ompi/mca/coll/libnbc/nbc_iallgatherv.c +++ b/ompi/mca/coll/libnbc/nbc_iallgatherv.c @@ -11,7 +11,7 @@ * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2014-2015 Research Organization for Information Science + * Copyright (c) 2014-2016 Research Organization for Information Science * and Technology (RIST). All rights reserved. * */ @@ -82,7 +82,8 @@ int ompi_coll_libnbc_iallgatherv(const void* sendbuf, int sendcount, MPI_Datatyp return res; } - res = NBC_Sched_send (sbuf, false, sendcount, sendtype, speer, schedule, false); + /* send to rank r - not from the sendbuf to optimize MPI_IN_PLACE */ + res = NBC_Sched_send (sbuf, false, recvcounts[rank], recvtype, speer, schedule, false); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { OBJ_RELEASE(schedule); return res;