X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/611d822b02f836d7abe031cced6adc4281ef4356..6633f5c4d1b7d52fa54306ee3fb7eb573daeb274:/src/smpi/colls/reduce/reduce-binomial.cpp diff --git a/src/smpi/colls/reduce/reduce-binomial.cpp b/src/smpi/colls/reduce/reduce-binomial.cpp index 196e9faa1d..352523146e 100644 --- a/src/smpi/colls/reduce/reduce-binomial.cpp +++ b/src/smpi/colls/reduce/reduce-binomial.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2018. 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 @@ -10,7 +10,7 @@ //#include namespace simgrid{ namespace smpi{ -int Coll_reduce_binomial::reduce(void *sendbuf, void *recvbuf, int count, +int Coll_reduce_binomial::reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm) { @@ -20,7 +20,6 @@ int Coll_reduce_binomial::reduce(void *sendbuf, void *recvbuf, int count, int dst; int tag = COLL_TAG_REDUCE; MPI_Aint extent; - void *tmp_buf; MPI_Aint true_lb, true_extent; if (count == 0) return 0; @@ -29,7 +28,7 @@ int Coll_reduce_binomial::reduce(void *sendbuf, void *recvbuf, int count, extent = datatype->get_extent(); - tmp_buf = (void *) smpi_get_tmp_sendbuffer(count * extent); + unsigned char* tmp_buf = smpi_get_tmp_sendbuffer(count * extent); int is_commutative = (op==MPI_OP_NULL || op->is_commutative()); mask = 1; @@ -43,7 +42,7 @@ int Coll_reduce_binomial::reduce(void *sendbuf, void *recvbuf, int count, datatype->extent(&true_lb, &true_extent); /* adjust for potential negative lower bound in datatype */ - tmp_buf = (void *)((char*)tmp_buf - true_lb); + tmp_buf = tmp_buf - true_lb; /* If I'm not the root, then my recvbuf may not be valid, therefore I have to allocate a temporary one */ @@ -87,7 +86,7 @@ int Coll_reduce_binomial::reduce(void *sendbuf, void *recvbuf, int count, } if (rank != root) { - smpi_free_tmp_buffer(recvbuf); + smpi_free_tmp_buffer(static_cast(recvbuf)); } smpi_free_tmp_buffer(tmp_buf);