X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d2012b2c49a0a6b424c0e4dbccd6a5aeaaa17b2e..158d49db67f6eabca7de5d4c8b44ffa9c9b946f6:/src/smpi/colls/reduce-binomial.c diff --git a/src/smpi/colls/reduce-binomial.c b/src/smpi/colls/reduce-binomial.c index a7ece3e238..c3b406741d 100644 --- a/src/smpi/colls/reduce-binomial.c +++ b/src/smpi/colls/reduce-binomial.c @@ -70,14 +70,17 @@ int smpi_coll_tuned_reduce_binomial(void *sendbuf, void *recvbuf, int count, mask <<= 1; } -if (!is_commutative && (root != 0)){ - if (rank == 0){ - smpi_mpi_send(recvbuf, count, datatype, root,tag, comm); - }else if (rank == root){ - smpi_mpi_recv(recvbuf, count, datatype, 0, tag, comm, &status); + if (!is_commutative && (root != 0)){ + if (rank == 0){ + smpi_mpi_send(recvbuf, count, datatype, root,tag, comm); + }else if (rank == root){ + smpi_mpi_recv(recvbuf, count, datatype, 0, tag, comm, &status); + } } -} + if (rank != root) { + xbt_free(recvbuf); + } free(tmp_buf); return 0;