X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a25724fe73cd35f31cd17fb4f43b7f516ca1f193..7749bb00b0a00619f255f091ec53f2b304be06d9:/src/smpi/smpi_base.c 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);