Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
clean_fun is the function that frees the userdata of a detached send
authorChristophe Thiéry <christopho128@gmail.com>
Thu, 5 Jan 2012 18:30:23 +0000 (19:30 +0100)
committerChristophe Thiéry <christopho128@gmail.com>
Thu, 5 Jan 2012 18:30:23 +0000 (19:30 +0100)
src/simix/smx_network.c
src/smpi/smpi_base.c

index 56be361..7cce2f7 100644 (file)
@@ -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;
   }
 }
 
index b358b67..91cb599 100644 (file)
@@ -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);