X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f734ec7475682eb90323e804cbcfddd7e4523992..db41dc7d999a5792aca42198b5bc87edb2dbfcce:/src/smpi/colls/alltoall/alltoall-mvapich-scatter-dest.cpp diff --git a/src/smpi/colls/alltoall/alltoall-mvapich-scatter-dest.cpp b/src/smpi/colls/alltoall/alltoall-mvapich-scatter-dest.cpp index bb5edb4fab..0a3cbc6cdb 100644 --- a/src/smpi/colls/alltoall/alltoall-mvapich-scatter-dest.cpp +++ b/src/smpi/colls/alltoall/alltoall-mvapich-scatter-dest.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2017. The SimGrid Team. +/* Copyright (c) 2013-2023. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -42,23 +42,19 @@ #define MV2_ALLTOALL_THROTTLE_FACTOR 4 #include "../colls_private.hpp" -namespace simgrid{ -namespace smpi{ -int Coll_alltoall_mvapich2_scatter_dest::alltoall( - void *sendbuf, - int sendcount, - MPI_Datatype sendtype, - void *recvbuf, - int recvcount, - MPI_Datatype recvtype, - MPI_Comm comm) +namespace simgrid::smpi { +int alltoall__mvapich2_scatter_dest(const void *sendbuf, + int sendcount, + MPI_Datatype sendtype, + void *recvbuf, + int recvcount, + MPI_Datatype recvtype, + MPI_Comm comm) { int comm_size, i, j; MPI_Aint sendtype_extent = 0, recvtype_extent = 0; int mpi_errno=MPI_SUCCESS; int dst, rank; - MPI_Request *reqarray; - MPI_Status *starray; if (recvcount == 0) return MPI_SUCCESS; @@ -93,9 +89,9 @@ int Coll_alltoall_mvapich2_scatter_dest::alltoall( /* FIXME: This should use the memory macros (there are storage leaks here if there is an error, for example) */ - reqarray= (MPI_Request*)xbt_malloc(2*bblock*sizeof(MPI_Request)); + auto* reqarray = new MPI_Request[2 * bblock]; - starray=(MPI_Status *)xbt_malloc(2*bblock*sizeof(MPI_Status)); + auto* starray = new MPI_Status[2 * bblock]; for (ii=0; ii