X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d20f024dba9ff1e9c8822237caaf963b9e913889..d15605f0ec704a59399fb71e6c145c72c4a9f1b0:/src/smpi/colls/gather/gather-ompi.cpp diff --git a/src/smpi/colls/gather/gather-ompi.cpp b/src/smpi/colls/gather/gather-ompi.cpp index 4510e088cb..7ee16c2c1e 100644 --- a/src/smpi/colls/gather/gather-ompi.cpp +++ b/src/smpi/colls/gather/gather-ompi.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2017. The SimGrid Team. +/* Copyright (c) 2013-2019. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -181,7 +181,7 @@ int Coll_gather_ompi_binomial::gather(void* sbuf, int scount, MPI_Datatype sdtyp /* other non-leaf nodes */ smpi_free_tmp_buffer(tempbuf); } - xbt_free(bmtree); + ompi_coll_tuned_topo_destroy_tree(&bmtree); return MPI_SUCCESS; err_hndl: @@ -266,8 +266,8 @@ int Coll_gather_ompi_linear_sync::gather(void *sbuf, int scount, - Waitall for all the second segments to complete. */ char* ptmp; - MPI_Request *reqs = NULL, first_segment_req; - reqs = (MPI_Request*)calloc(size, sizeof(MPI_Request)); + MPI_Request first_segment_req; + MPI_Request* reqs = new (std::nothrow) MPI_Request[size]; if (NULL == reqs) { ret = -1; line = __LINE__; @@ -319,7 +319,7 @@ int Coll_gather_ompi_linear_sync::gather(void *sbuf, int scount, ret = Request::waitall(size, reqs, MPI_STATUSES_IGNORE); if (ret != MPI_SUCCESS) { line = __LINE__; goto error_hndl; } - free(reqs); + delete[] reqs; } /* All done */