X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1ae612ef301a26795068505cf761169ed29a5451..2be0e4648c5b7055580df1c265b7c43ee6763a46:/src/smpi/smpi_base.c diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index 076cd429da..39859d8ba0 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -63,6 +63,11 @@ static MPI_Request build_request(void *buf, int count, return request; } +static void smpi_mpi_request_free_voidp(void* request) +{ + smpi_mpi_request_free(request); +} + /* MPI Low level calls */ MPI_Request smpi_mpi_send_init(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm) @@ -114,7 +119,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_voidp, // how to free the userdata if a detached send fails request, // detach if msg size < eager/rdv switch limit detached); @@ -294,11 +300,11 @@ int smpi_mpi_testany(int count, MPI_Request requests[], int *index, void smpi_mpi_wait(MPI_Request * request, MPI_Status * status) { print_request("Waiting", *request); - if ((*request)->action != NULL) { - - SIMIX_req_comm_wait((*request)->action, -1.0); + if ((*request)->action != NULL) { // this is not a detached send + SIMIX_req_comm_wait((*request)->action, -1.0); + finish_wait(request, status); } - finish_wait(request, status); + // FIXME for a detached send, finish_wait is not called: } int smpi_mpi_waitany(int count, MPI_Request requests[],