Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2022.
[simgrid.git] / src / smpi / colls / allgather / allgather-rdb.cpp
index 8fb6efa..314a390 100644 (file)
@@ -1,16 +1,19 @@
-/* Copyright (c) 2013-2014. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2013-2022. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
+#include "smpi_status.hpp"
+
+namespace simgrid{
+namespace smpi{
 
 int
-smpi_coll_tuned_allgather_rdb(void *sbuf, int send_count,
-                              MPI_Datatype send_type, void *rbuf,
-                              int recv_count, MPI_Datatype recv_type,
-                              MPI_Comm comm)
+allgather__rdb(const void *sbuf, int send_count,
+               MPI_Datatype send_type, void *rbuf,
+               int recv_count, MPI_Datatype recv_type,
+               MPI_Comm comm)
 {
   // MPI variables
   MPI_Status status;
@@ -29,7 +32,7 @@ smpi_coll_tuned_allgather_rdb(void *sbuf, int send_count,
   char *send_ptr = (char *) sbuf;
   char *recv_ptr = (char *) rbuf;
 
-  // get size of the communicator, followed by rank 
+  // get size of the communicator, followed by rank
   unsigned int num_procs = comm->size();
   unsigned int rank = comm->rank();
 
@@ -60,7 +63,7 @@ smpi_coll_tuned_allgather_rdb(void *sbuf, int send_count,
       Request::sendrecv(recv_ptr + send_offset, curr_count, send_type, dst,
                    tag, recv_ptr + recv_offset, mask * recv_count,
                    recv_type, dst, tag, comm, &status);
-      last_recv_count = smpi_mpi_get_count(&status, recv_type);
+      last_recv_count = Status::get_count(&status, recv_type);
       curr_count += last_recv_count;
     }
 
@@ -113,7 +116,7 @@ smpi_coll_tuned_allgather_rdb(void *sbuf, int send_count,
                    recv_type, dst, tag, comm, &status);
           // num_procs_completed is also equal to the no. of processes
           // whose data we don't have
-          last_recv_count = smpi_mpi_get_count(&status, recv_type);
+          last_recv_count = Status::get_count(&status, recv_type);
           curr_count += last_recv_count;
         }
         tmp_mask >>= 1;
@@ -127,3 +130,7 @@ smpi_coll_tuned_allgather_rdb(void *sbuf, int send_count,
 
   return success;
 }
+
+
+}
+}