X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0e9c0448c6566825b170b98ecff716b098bda10e..1687df79d61a9418bba830bbd0ab7de16e457090:/src/smpi/colls/alltoall-2dmesh.c diff --git a/src/smpi/colls/alltoall-2dmesh.c b/src/smpi/colls/alltoall-2dmesh.c index 08f4db2cb3..dc9971627e 100644 --- a/src/smpi/colls/alltoall-2dmesh.c +++ b/src/smpi/colls/alltoall-2dmesh.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. */ + #include "colls_private.h" #include @@ -74,8 +80,8 @@ int smpi_coll_tuned_alltoall_2dmesh(void *send_buff, int send_count, block_size = extent * send_count; - tmp_buff1 = (char *) xbt_malloc(block_size * num_procs * Y); - tmp_buff2 = (char *) xbt_malloc(block_size * Y); + tmp_buff1 = (char *) smpi_get_tmp_sendbuffer(block_size * num_procs * Y); + tmp_buff2 = (char *) smpi_get_tmp_recvbuffer(block_size * Y); num_reqs = X; if (Y > X) @@ -86,8 +92,6 @@ int smpi_coll_tuned_alltoall_2dmesh(void *send_buff, int send_count, req_ptr = reqs; - send_offset = recv_offset = (rank % Y) * block_size * num_procs; - count = send_count * num_procs; for (i = 0; i < Y; i++) { @@ -164,7 +168,7 @@ int smpi_coll_tuned_alltoall_2dmesh(void *send_buff, int send_count, smpi_mpi_waitall(X - 1, reqs, statuses); free(reqs); free(statuses); - free(tmp_buff1); - free(tmp_buff2); + smpi_free_tmp_buffer(tmp_buff1); + smpi_free_tmp_buffer(tmp_buff2); return MPI_SUCCESS; }