From: Augustin Degomme Date: Mon, 29 Sep 2014 12:01:07 +0000 (+0200) Subject: add some more calls to smpi temp buffers allocation functions X-Git-Tag: v3_12~788^2~4 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a87229d9706b516bc0c48d440fc9eb0fb8861786 add some more calls to smpi temp buffers allocation functions --- diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index 035c5eface..940cbe2bd3 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -1372,7 +1372,7 @@ void smpi_mpi_reduce(void *sendbuf, void *recvbuf, int count, char* sendtmpbuf = (char*) sendbuf; if( sendbuf == MPI_IN_PLACE ) { - sendtmpbuf = (char *)xbt_malloc(count*smpi_datatype_get_extent(datatype)); + sendtmpbuf = (char *)smpi_get_tmp_sendbuffer(count*smpi_datatype_get_extent(datatype)); smpi_datatype_copy(recvbuf, count, datatype,sendtmpbuf, count, datatype); } @@ -1433,7 +1433,7 @@ void smpi_mpi_reduce(void *sendbuf, void *recvbuf, int count, xbt_free(requests); if( sendbuf == MPI_IN_PLACE ) { - xbt_free(sendtmpbuf); + smpi_free_tmp_buffer(sendtmpbuf); } } } @@ -1470,7 +1470,7 @@ void smpi_mpi_scan(void *sendbuf, void *recvbuf, int count, for(other = 0; other < rank; other++) { // FIXME: possibly overkill we we have contiguous/noncontiguous data // mapping... - tmpbufs[index] = xbt_malloc(count * dataext); + tmpbufs[index] = smpi_get_tmp_sendbuffer(count * dataext); requests[index] = smpi_irecv_init(tmpbufs[index], count, datatype, other, system_tag, comm); @@ -1505,7 +1505,7 @@ void smpi_mpi_scan(void *sendbuf, void *recvbuf, int count, } } for(index = 0; index < rank; index++) { - xbt_free(tmpbufs[index]); + smpi_free_tmp_buffer(tmpbufs[index]); } for(index = 0; index < size-1; index++) { smpi_mpi_request_free(&requests[index]); @@ -1536,7 +1536,7 @@ void smpi_mpi_exscan(void *sendbuf, void *recvbuf, int count, for(other = 0; other < rank; other++) { // FIXME: possibly overkill we we have contiguous/noncontiguous data // mapping... - tmpbufs[index] = xbt_malloc(count * dataext); + tmpbufs[index] = smpi_get_tmp_sendbuffer(count * dataext); requests[index] = smpi_irecv_init(tmpbufs[index], count, datatype, other, system_tag, comm); @@ -1577,7 +1577,7 @@ void smpi_mpi_exscan(void *sendbuf, void *recvbuf, int count, } } for(index = 0; index < rank; index++) { - xbt_free(tmpbufs[index]); + smpi_free_tmp_buffer(tmpbufs[index]); } for(index = 0; index < size-1; index++) { smpi_mpi_request_free(&requests[index]);