Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
(painfully) constify colls.
[simgrid.git] / src / smpi / colls / allreduce / allreduce-mvapich-rs.cpp
index 5187221..d5102b1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2014. 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
  *
  */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
+#include <algorithm>
+
 namespace simgrid{
 namespace smpi{
-int Coll_allreduce_mvapich2_rs::allreduce(void *sendbuf,
+int Coll_allreduce_mvapich2_rs::allreduce(const void *sendbuf,
                             void *recvbuf,
                             int count,
                             MPI_Datatype datatype,
@@ -53,7 +55,7 @@ int Coll_allreduce_mvapich2_rs::allreduce(void *sendbuf,
     datatype->extent(&true_lb, &true_extent);
     extent = datatype->get_extent();
 
-    tmp_buf_free= smpi_get_tmp_recvbuffer(count * (MAX(extent, true_extent)));
+    tmp_buf_free = smpi_get_tmp_recvbuffer(count * std::max(extent, true_extent));
 
     /* adjust for potential negative lower bound in datatype */
     tmp_buf = (void *) ((char *) tmp_buf_free - true_lb);