From 705147e98b8209a1c49e24ab9d828f7e1071c35d Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Thu, 6 Nov 2014 19:25:18 +0900 Subject: [PATCH] coll/tuned: fix allgather bruck algorithm --- ompi/mca/coll/tuned/coll_tuned_allgather.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ompi/mca/coll/tuned/coll_tuned_allgather.c b/ompi/mca/coll/tuned/coll_tuned_allgather.c index a10a2372a0..5bc46524c1 100644 --- a/ompi/mca/coll/tuned/coll_tuned_allgather.c +++ b/ompi/mca/coll/tuned/coll_tuned_allgather.c @@ -192,13 +192,13 @@ int ompi_coll_tuned_allgather_intra_bruck(void *sbuf, int scount, err = ompi_datatype_get_true_extent(rdtype, &true_lb, &true_extent); if (MPI_SUCCESS != err) { line = __LINE__; goto err_hndl; } - free_buf = (char*) calloc(((true_extent - true_lb + + free_buf = (char*) calloc(((true_extent + ((ptrdiff_t)(size - rank) * (ptrdiff_t)rcount - 1) * rext)), sizeof(char)); if (NULL == free_buf) { line = __LINE__; err = OMPI_ERR_OUT_OF_RESOURCE; goto err_hndl; } - shift_buf = free_buf - rlb; + shift_buf = free_buf - true_lb; /* 1. copy blocks [0 .. (size - rank - 1)] from rbuf to shift buffer */ err = ompi_datatype_copy_content_same_ddt(rdtype, ((ptrdiff_t)(size - rank) * (ptrdiff_t)rcount),