From 7749bb00b0a00619f255f091ec53f2b304be06d9 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Tue, 8 Jul 2014 15:32:42 +0200 Subject: [PATCH] leak -- --- src/smpi/smpi_base.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index a86a8a8567..38011e60e7 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -634,18 +634,17 @@ static void finish_wait(MPI_Request * request, MPI_Status * status) switch_data_segment(smpi_process_index()); } } - if(req->flags & RECV) { - - 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; - subtype->unserialize(req->buf, req->old_buf, req->real_size/smpi_datatype_size(datatype) , datatype->substruct, req->op); - if(req->detached == 0) free(req->buf); - }else{//apply op on contiguous buffer for accumulate - int n =req->real_size/smpi_datatype_size(datatype); - smpi_op_apply(req->op, req->buf, req->old_buf, &n, &datatype); - } + + 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, req->op); + if(req->detached == 0) free(req->buf); + }else if(req->flags & RECV){//apply op on contiguous buffer for accumulate + int n =req->real_size/smpi_datatype_size(datatype); + smpi_op_apply(req->op, req->buf, req->old_buf, &n, &datatype); } } smpi_comm_unuse(req->comm); -- 2.20.1