- if(status != MPI_STATUS_IGNORE) {
- status->MPI_SOURCE = req->src;
- status->MPI_TAG = req->tag;
- //if((*request)->action && ((MPI_Request)SIMIX_comm_get_src_data((*request)->action))->size == (*request)->size)
- status->MPI_ERROR = MPI_SUCCESS;
- //else status->MPI_ERROR = MPI_ERR_TRUNCATE;
- // this handles the case were size in receive differs from size in send
- // FIXME: really this should just contain the count of receive-type blocks,
- // right?
- status->count = req->size;
- }
- req = *request;
-
- print_request("Finishing", req);
- MPI_Datatype datatype = req->old_type;
- if(datatype->has_subtype == 1){
- // This part handles the problem of non-contignous memory
- // the unserialization at the reception
- s_smpi_subtype_t *subtype = datatype->substruct;
- if(req->flags & RECV) {
- subtype->unserialize(req->buf, req->old_buf, req->size/smpi_datatype_size(datatype) , datatype->substruct);
+ print_request("Finishing", req);
+ MPI_Datatype datatype = req->old_type;
+
+ if(datatype->has_subtype == 1){
+ // This part handles the problem of non-contignous memory
+ // the unserialization at the reception
+ s_smpi_subtype_t *subtype = datatype->substruct;
+ if(req->flags & RECV) {
+ subtype->unserialize(req->buf, req->old_buf, req->real_size/smpi_datatype_size(datatype) , datatype->substruct);
+ }
+ if(req->detached == 0) free(req->buf);