-/* 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
* 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{
else {
int creq = 0;
- MPI_Request* sreq = NULL;
-
- sreq = (MPI_Request*) calloc( max_outstanding_reqs,
- sizeof(MPI_Request ) );
+ MPI_Request* sreq = new (std::nothrow) MPI_Request[max_outstanding_reqs];
if (NULL == sreq) { line = __LINE__; ret = -1; goto error_hndl; }
/* post first group of requests */
MPI_STATUSES_IGNORE );
/* free requests */
- free(sreq);
+ delete[] sreq;
}
}
- free(tree);
+ ompi_coll_tuned_topo_destroy_tree(&tree);
return MPI_SUCCESS;
error_hndl: /* error handler */
XBT_DEBUG("ERROR_HNDL: node %d file %s line %d error %d\n",
rank, __FILE__, line, ret );
- if( inbuf_free[0] != NULL ) free(inbuf_free[0]);
- if( inbuf_free[1] != NULL ) free(inbuf_free[1]);
- if( accumbuf_free != NULL ) free(accumbuf);
+ smpi_free_tmp_buffer(inbuf_free[0]);
+ smpi_free_tmp_buffer(inbuf_free[1]);
+ smpi_free_tmp_buffer(accumbuf);
return ret;
}