X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/befbbbe1fbb31663a8f91e24ce12df271cf4ae79..88f49b34e91fe95b712d1545ae71a0896f5466c1:/src/smpi/colls/bcast/bcast-ompi-pipeline.cpp diff --git a/src/smpi/colls/bcast/bcast-ompi-pipeline.cpp b/src/smpi/colls/bcast/bcast-ompi-pipeline.cpp index 425fcab111..ea77d922ad 100644 --- a/src/smpi/colls/bcast/bcast-ompi-pipeline.cpp +++ b/src/smpi/colls/bcast/bcast-ompi-pipeline.cpp @@ -1,21 +1,21 @@ -/* Copyright (c) 2013-2017. The SimGrid Team. +/* Copyright (c) 2013-2020. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ - #include "../colls_private.h" - #include "../coll_tuned_topo.h" +#include "../coll_tuned_topo.hpp" +#include "../colls_private.hpp" #define MAXTREEFANOUT 32 namespace simgrid{ namespace smpi{ -int Coll_bcast_ompi_pipeline::bcast( void* buffer, - int original_count, - MPI_Datatype datatype, - int root, - MPI_Comm comm) +int bcast__ompi_pipeline( void* buffer, + int original_count, + MPI_Datatype datatype, + int root, + MPI_Comm comm) { int count_by_segment = original_count; size_t type_size; @@ -35,7 +35,7 @@ int Coll_bcast_ompi_pipeline::bcast( void* buffer, char *tmpbuf; ptrdiff_t extent; MPI_Request recv_reqs[2] = {MPI_REQUEST_NULL, MPI_REQUEST_NULL}; - MPI_Request *send_reqs = NULL; + MPI_Request* send_reqs = nullptr; int req_index; /** @@ -85,7 +85,7 @@ int Coll_bcast_ompi_pipeline::bcast( void* buffer, tmpbuf = (char *) buffer; if( tree->tree_nextsize != 0 ) { - send_reqs = xbt_new(MPI_Request, tree->tree_nextsize ); + send_reqs = new MPI_Request[tree->tree_nextsize]; } /* Root code */ @@ -205,8 +205,8 @@ int Coll_bcast_ompi_pipeline::bcast( void* buffer, Request::wait( &recv_reqs[req_index], MPI_STATUS_IGNORE ); } - if( NULL != send_reqs ) free(send_reqs); - xbt_free(tree); + delete[] send_reqs; + ompi_coll_tuned_topo_destroy_tree(&tree); return (MPI_SUCCESS); }