Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright headers.
[simgrid.git] / src / smpi / colls / allreduce / allreduce-mvapich-rs.cpp
index e8789a1..66ec877 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2014. The SimGrid Team.
+/* Copyright (c) 2013-2018. 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>
 
-int smpi_coll_tuned_allreduce_mvapich2_rs(void *sendbuf,
+namespace simgrid{
+namespace smpi{
+int Coll_allreduce_mvapich2_rs::allreduce(void *sendbuf,
                             void *recvbuf,
                             int count,
                             MPI_Datatype datatype,
@@ -52,7 +55,7 @@ int smpi_coll_tuned_allreduce_mvapich2_rs(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);
@@ -288,3 +291,6 @@ int smpi_coll_tuned_allreduce_mvapich2_rs(void *sendbuf,
     return (mpi_errno);
 
 }
+
+}
+}