From: Christophe ThiƩry Date: Thu, 5 Jan 2012 18:30:23 +0000 (+0100) Subject: clean_fun is the function that frees the userdata of a detached send X-Git-Tag: exp_20120216~195^2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/52829c86978c0bee71a0dcd43d4a07a5922d06c2 clean_fun is the function that frees the userdata of a detached send --- diff --git a/src/simix/smx_network.c b/src/simix/smx_network.c index 56be361af0..7cce2f7917 100644 --- a/src/simix/smx_network.c +++ b/src/simix/smx_network.c @@ -884,8 +884,8 @@ void smpi_comm_copy_data_callback(smx_action_t comm, size_t buff_size) XBT_DEBUG("Copy the data over"); memcpy(comm->comm.dst_buff, comm->comm.src_buff, buff_size); if (comm->comm.detached) { // if this is a detached send, the source buffer was duplicated by SMPI sender to make the original buffer available to the application ASAP - comm->comm.clean_fun(comm->comm.src_buff); - comm->comm.src_buff = NULL; + xbt_free(comm->comm.src_buff); + comm->comm.src_buff = NULL; } } diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index b358b671f5..91cb5993e4 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -114,7 +114,8 @@ void smpi_mpi_start(MPI_Request request) request->action = SIMIX_req_comm_isend(mailbox, request->size, -1.0, request->buf, request->size, - &match_send,free, // a simple free is used to free the buffer + &match_send, + &smpi_mpi_request_free, // how to free the userdata if a detached send fails request, // detach if msg size < eager/rdv switch limit detached);