-/* Copyright (c) 2013-2017. The SimGrid Team.
+/* Copyright (c) 2013-2018. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* Additional copyrights may follow
*/
-#include "../colls_private.h"
-#include "../coll_tuned_topo.h"
+#include "../coll_tuned_topo.hpp"
+#include "../colls_private.hpp"
namespace simgrid{
namespace smpi{
/* other non-leaf nodes */
smpi_free_tmp_buffer(tempbuf);
}
- xbt_free(bmtree);
+ ompi_coll_tuned_topo_destroy_tree(&bmtree);
return MPI_SUCCESS;
err_hndl:
- 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__;
ret = Request::waitall(size, reqs, MPI_STATUSES_IGNORE);
if (ret != MPI_SUCCESS) { line = __LINE__; goto error_hndl; }
- free(reqs);
+ delete[] reqs;
}
/* All done */