Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add new entry in Release_Notes.
[simgrid.git] / src / smpi / colls / allreduce / allreduce-lr.cpp
index 4d24d5a..517bd69 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2020. 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
@@ -18,8 +18,7 @@
 */
 
 //#include <star-reduction.c>
-namespace simgrid {
-namespace smpi {
+namespace simgrid::smpi {
 int allreduce__lr(const void *sbuf, void *rbuf, int rcount,
                   MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)
 {
@@ -36,10 +35,9 @@ int allreduce__lr(const void *sbuf, void *rbuf, int rcount,
   MPI_Aint extent;
   extent = dtype->get_extent();
 
-  /* when communication size is smaller than number of process (not support) */
   if (rcount < size) {
-    XBT_WARN("MPI_allreduce_lr use default MPI_allreduce.");
-    allreduce__default(sbuf, rbuf, rcount, dtype, op, comm);
+    XBT_INFO("MPI_allreduce_lr: communication size smaller than number of process, use default MPI_allreduce.");
+    allreduce__redbcast(sbuf, rbuf, rcount, dtype, op, comm);
     return MPI_SUCCESS;
   }
 
@@ -102,5 +100,4 @@ int allreduce__lr(const void *sbuf, void *rbuf, int rcount,
 
   return 0;
 }
-}
-}
+} // namespace simgrid::smpi