Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add new entry in Release_Notes.
[simgrid.git] / src / smpi / colls / allreduce / allreduce-rab2.cpp
index ae9f3a2..a66a765 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2019. 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
@@ -7,12 +7,11 @@
 #include "../colls_private.hpp"
 //#include <star-reduction.c>
 
-namespace simgrid{
-namespace smpi{
+namespace simgrid::smpi {
 // this requires that count >= NP
-int Coll_allreduce_rab2::allreduce(const void *sbuff, void *rbuff,
-                                   int count, MPI_Datatype dtype,
-                                   MPI_Op op, MPI_Comm comm)
+int allreduce__rab2(const void *sbuff, void *rbuff,
+                    int count, MPI_Datatype dtype,
+                    MPI_Op op, MPI_Comm comm)
 {
   MPI_Aint s_extent;
   int i, rank, nprocs;
@@ -47,7 +46,7 @@ int Coll_allreduce_rab2::allreduce(const void *sbuff, void *rbuff,
 
     memcpy(send, sbuff, s_extent * count);
 
-    Colls::alltoall(send, send_size, dtype, recv, send_size, dtype, comm);
+    colls::alltoall(send, send_size, dtype, recv, send_size, dtype, comm);
 
     memcpy(tmp, recv, nbytes);
 
@@ -55,7 +54,7 @@ int Coll_allreduce_rab2::allreduce(const void *sbuff, void *rbuff,
       if (op != MPI_OP_NULL)
         op->apply(recv + s_offset, tmp, &send_size, dtype);
 
-    Colls::allgather(tmp, send_size, dtype, recv, send_size, dtype, comm);
+    colls::allgather(tmp, send_size, dtype, recv, send_size, dtype, comm);
     memcpy(rbuff, recv, count * s_extent);
 
     smpi_free_tmp_buffer(recv);
@@ -69,7 +68,7 @@ int Coll_allreduce_rab2::allreduce(const void *sbuff, void *rbuff,
 
     unsigned char* recv = smpi_get_tmp_recvbuffer(s_extent * send_size * nprocs);
 
-    Colls::alltoall(send, send_size, dtype, recv, send_size, dtype, comm);
+    colls::alltoall(send, send_size, dtype, recv, send_size, dtype, comm);
 
     memcpy((char *) rbuff + r_offset, recv, nbytes);
 
@@ -77,12 +76,10 @@ int Coll_allreduce_rab2::allreduce(const void *sbuff, void *rbuff,
       if (op != MPI_OP_NULL)
         op->apply(recv + s_offset, static_cast<char*>(rbuff) + r_offset, &send_size, dtype);
 
-    Colls::allgather((char *) rbuff + r_offset, send_size, dtype, rbuff, send_size,
-                  dtype, comm);
+    colls::allgather((char*)rbuff + r_offset, send_size, dtype, rbuff, send_size, dtype, comm);
     smpi_free_tmp_buffer(recv);
   }
 
   return MPI_SUCCESS;
 }
-}
-}
+} // namespace simgrid::smpi