From f9bebe53f9e2a4d27ea04de58d1763274c25df8d Mon Sep 17 00:00:00 2001 From: Mike Dubman Date: Wed, 6 Oct 2010 19:09:02 +0000 Subject: [PATCH] - fix fca support for MPI_IN_PLACE in allgather and allgatherv collectives This commit was SVN r23841. --- ompi/mca/coll/fca/coll_fca_ops.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ompi/mca/coll/fca/coll_fca_ops.c b/ompi/mca/coll/fca/coll_fca_ops.c index e98a05abfa..3031a83542 100644 --- a/ompi/mca/coll/fca/coll_fca_ops.c +++ b/ompi/mca/coll/fca/coll_fca_ops.c @@ -273,14 +273,6 @@ int mca_coll_fca_allgather(void *sbuf, int scount, struct ompi_datatype_t *sdtyp spec.sbuf = sbuf; spec.rbuf = rbuf; - if (MPI_IN_PLACE == spec.sbuf) { - FCA_VERBOSE(10, "Using MPI_IN_PLACE for sbuf"); - spec.sbuf = spec.rbuf; - } else if (MPI_IN_PLACE == spec.rbuf) { - FCA_VERBOSE(10, "Using MPI_IN_PLACE for rbuf"); - spec.rbuf = spec.sbuf; - } - spec.size = mca_coll_fca_get_buf_size(sdtype, scount, scount); if (spec.size < 0 || spec.size > fca_module->fca_comm_caps.max_payload || @@ -295,6 +287,11 @@ int mca_coll_fca_allgather(void *sbuf, int scount, struct ompi_datatype_t *sdtyp goto orig_allgather; } + if (MPI_IN_PLACE == spec.sbuf) { + FCA_VERBOSE(10, "Using MPI_IN_PLACE for sbuf"); + spec.sbuf = spec.rbuf + spec.size * fca_module->rank; + } + FCA_VERBOSE(5,"Using FCA Allgather"); ret = mca_coll_fca_component.fca_ops.do_allgather(fca_module->fca_comm, &spec); if (ret < 0) { @@ -345,6 +342,11 @@ int mca_coll_fca_allgatherv(void *sbuf, int scount, spec.displs[i] = disps[i] * relemsize; } + if (MPI_IN_PLACE == spec.sbuf) { + FCA_VERBOSE(10, "Using MPI_IN_PLACE for sbuf"); + spec.sbuf = spec.rbuf + spec.displs[fca_module->rank]; + } + FCA_VERBOSE(5,"Using FCA Allgatherv"); ret = mca_coll_fca_component.fca_ops.do_allgatherv(fca_module->fca_comm, &spec); if (ret < 0) {