From 52829c86978c0bee71a0dcd43d4a07a5922d06c2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christophe=20Thi=C3=A9ry?= Date: Thu, 5 Jan 2012 19:30:23 +0100 Subject: [PATCH 1/1] clean_fun is the function that frees the userdata of a detached send --- src/simix/smx_network.c | 4 ++-- src/smpi/smpi_base.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) 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); -- 2.20.1