X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a5e77eb8c0cb5fe6fa93bd52e8ffe50fcd9467ca..954676b700e711f38ec4d286d33d5427d3f4ca46:/src/smpi/colls/allgatherv-mpich-rdb.c diff --git a/src/smpi/colls/allgatherv-mpich-rdb.c b/src/smpi/colls/allgatherv-mpich-rdb.c index 8094db08cc..e4edda955e 100644 --- a/src/smpi/colls/allgatherv-mpich-rdb.c +++ b/src/smpi/colls/allgatherv-mpich-rdb.c @@ -1,3 +1,9 @@ +/* Copyright (c) 2013-2014. The SimGrid Team. + * All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + /* Short or medium size message and power-of-two no. of processes. Use * recursive doubling algorithm */ #include "colls_private.h" @@ -15,7 +21,7 @@ int smpi_coll_tuned_allgatherv_mpich_rdb ( MPI_Status status; MPI_Aint recvtype_extent, recvtype_true_extent, recvtype_true_lb; int curr_cnt, dst, total_count; - void *tmp_buf; + void *tmp_buf, *tmp_buf_rl; int mask, dst_tree_root, my_tree_root, position, send_offset, recv_offset, last_recv_cnt=0, nprocs_completed, k, offset, tmp_mask, tree_root; @@ -36,10 +42,10 @@ int smpi_coll_tuned_allgatherv_mpich_rdb ( smpi_datatype_extent(recvtype, &recvtype_true_lb, &recvtype_true_extent); - tmp_buf= (void*)xbt_malloc(total_count*(max(recvtype_true_extent,recvtype_extent))); + tmp_buf_rl= (void*)smpi_get_tmp_sendbuffer(total_count*(max(recvtype_true_extent,recvtype_extent))); /* adjust for potential negative lower bound in datatype */ - tmp_buf = (void *)((char*)tmp_buf - recvtype_true_lb); + tmp_buf = (void *)((char*)tmp_buf_rl - recvtype_true_lb); /* copy local data into right location in tmp_buf */ position = 0; @@ -203,6 +209,6 @@ int smpi_coll_tuned_allgatherv_mpich_rdb ( position += recvcounts[j]; } - free(tmp_buf); + smpi_free_tmp_buffer(tmp_buf_rl); return MPI_SUCCESS; }