]> AND Public Git Repository - simgrid.git/blobdiff - src/smpi/colls/allreduce/allreduce-rab1.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
MPI Win: add check if we try to delete a locked or opened window.
[simgrid.git] / src / smpi / colls / allreduce / allreduce-rab1.cpp
index e5ff57aaca332bc8e925572bb3493a8b4c8ebb33..997598a7dee0c4578a8ac69833da03ef1d57e72e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2019. The SimGrid Team.
+/* Copyright (c) 2013-2022. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -9,9 +9,9 @@
 namespace simgrid{
 namespace smpi{
 // NP pow of 2 for now
-int Coll_allreduce_rab1::allreduce(const void *sbuff, void *rbuff,
-                                   int count, MPI_Datatype dtype,
-                                   MPI_Op op, MPI_Comm comm)
+int allreduce__rab1(const void *sbuff, void *rbuff,
+                    int count, MPI_Datatype dtype,
+                    MPI_Op op, MPI_Comm comm)
 {
   MPI_Status status;
   MPI_Aint extent;
@@ -23,7 +23,7 @@ int Coll_allreduce_rab1::allreduce(const void *sbuff, void *rbuff,
   unsigned int nprocs = comm->size();
 
   if((nprocs&(nprocs-1)))
-    THROWF(arg_error,0, "allreduce rab1 algorithm can't be used with non power of two number of processes ! ");
+    throw std::invalid_argument("allreduce rab1 algorithm can't be used with non power of two number of processes!");
 
   extent = dtype->get_extent();
 
@@ -67,7 +67,7 @@ int Coll_allreduce_rab1::allreduce(const void *sbuff, void *rbuff,
     }
 
     memcpy(tmp_buf, recv + recv_idx * extent, recv_cnt * extent);
-    Colls::allgather(tmp_buf, recv_cnt, dtype, recv, recv_cnt, dtype, comm);
+    colls::allgather(tmp_buf, recv_cnt, dtype, recv, recv_cnt, dtype, comm);
 
     memcpy(rbuff, recv, count * extent);
     smpi_free_tmp_buffer(recv);
@@ -101,7 +101,7 @@ int Coll_allreduce_rab1::allreduce(const void *sbuff, void *rbuff,
     }
 
     memcpy(tmp_buf, (char *) rbuff + recv_idx * extent, recv_cnt * extent);
-    Colls::allgather(tmp_buf, recv_cnt, dtype, rbuff, recv_cnt, dtype, comm);
+    colls::allgather(tmp_buf, recv_cnt, dtype, rbuff, recv_cnt, dtype, comm);
     smpi_free_tmp_buffer(tmp_buf);
   }