X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1d19a5ec3d87dc7d3d8644fa15526f6a7786da04..7f7227c8cf8d97a74535ea8f066aa35afa2d8d09:/src/smpi/colls/reduce-scatter-gather.c diff --git a/src/smpi/colls/reduce-scatter-gather.c b/src/smpi/colls/reduce-scatter-gather.c index 280e3e8f3f..19c67947a1 100644 --- a/src/smpi/colls/reduce-scatter-gather.c +++ b/src/smpi/colls/reduce-scatter-gather.c @@ -15,7 +15,7 @@ int smpi_coll_tuned_reduce_scatter_gather(void *sendbuf, void *recvbuf, int recv_idx, last_idx = 0, newdst; int dst, send_cnt, recv_cnt, newroot, newdst_tree_root; int newroot_tree_root, new_count; - int tag = 4321; + int tag = COLL_TAG_REDUCE; void *send_ptr, *recv_ptr, *tmp_buf; cnts = NULL; @@ -41,7 +41,7 @@ int smpi_coll_tuned_reduce_scatter_gather(void *sendbuf, void *recvbuf, send_ptr = (void *) xbt_malloc(new_count * extent); recv_ptr = (void *) xbt_malloc(new_count * extent); tmp_buf = (void *) xbt_malloc(new_count * extent); - memcpy(send_ptr, sendbuf, extent * new_count); + memcpy(send_ptr, sendbuf, extent * count); //if ((rank != root)) smpi_mpi_sendrecv(send_ptr, new_count, datatype, rank, tag, @@ -387,6 +387,8 @@ int smpi_coll_tuned_reduce_scatter_gather(void *sendbuf, void *recvbuf, } } } + if (tmp_buf) + free(tmp_buf); if (cnts) free(cnts); if (disps)