X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/befbbbe1fbb31663a8f91e24ce12df271cf4ae79..d5cc61332edae35867a41bb38ad9401faaab2716:/src/smpi/colls/reduce_scatter/reduce_scatter-mpich.cpp diff --git a/src/smpi/colls/reduce_scatter/reduce_scatter-mpich.cpp b/src/smpi/colls/reduce_scatter/reduce_scatter-mpich.cpp index 39128a2e9f..74bc22566a 100644 --- a/src/smpi/colls/reduce_scatter/reduce_scatter-mpich.cpp +++ b/src/smpi/colls/reduce_scatter/reduce_scatter-mpich.cpp @@ -1,10 +1,11 @@ -/* 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 * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "../colls_private.h" +#include "../colls_private.hpp" +#include static inline int MPIU_Mirror_permutation(unsigned int x, int bits) { @@ -23,12 +24,11 @@ static inline int MPIU_Mirror_permutation(unsigned int x, int bits) namespace simgrid{ namespace smpi{ -int Coll_reduce_scatter_mpich_pair::reduce_scatter(void *sendbuf, void *recvbuf, int recvcounts[], +int Coll_reduce_scatter_mpich_pair::reduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts[], MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { int rank, comm_size, i; MPI_Aint extent, true_extent, true_lb; - int *disps; void *tmp_recvbuf; int mpi_errno = MPI_SUCCESS; int total_count, dst, src; @@ -43,7 +43,7 @@ int Coll_reduce_scatter_mpich_pair::reduce_scatter(void *sendbuf, void *recvbuf, is_commutative = 1; } - disps = (int*)xbt_malloc( comm_size * sizeof(int)); + int* disps = new int[comm_size]; total_count = 0; for (i=0; i