X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0f86d40fdf09712d615dcc7c8ae54e75ff841301..bfb1fc1be00a83251377e2652e9c60b9bcf8204a:/src/smpi/smpi_base.c diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index f5aa890b12..1751f2570a 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -107,11 +107,16 @@ void smpi_mpi_start(MPI_Request request) detached = 1; request->buf = malloc(request->size); memcpy(request->buf,oldbuf,request->size); + XBT_DEBUG("Send request %p is detached; buf %p copied into %p",request,oldbuf,request->buf); + } else { + XBT_DEBUG("Send request %p is not detached (buf: %p)",request,request->buf); } - request->action = SIMIX_req_comm_isend(mailbox, request->size, -1.0, - request->buf, request->size, &match_send, request, + request->buf, request->size, + &match_send, + (void (*)(void *))&smpi_mpi_request_free, // how to free the userdata if a detached send fails + request, // detach if msg size < eager/rdv switch limit detached); @@ -290,9 +295,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); - finish_wait(request, status); + if ((*request)->action != NULL) { // this is not a detached send + SIMIX_req_comm_wait((*request)->action, -1.0); + finish_wait(request, status); + } + // FIXME for a detached send, finish_wait is not called: } int smpi_mpi_waitany(int count, MPI_Request requests[],