Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines.
[simgrid.git] / src / smpi / colls / alltoall / alltoall-rdb.cpp
index 92a0722..ae80a88 100644 (file)
@@ -1,10 +1,11 @@
-/* Copyright (c) 2013-2014. The SimGrid Team.
+/* Copyright (c) 2013-2021. 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"
 
 /*****************************************************************************
 
@@ -12,7 +13,7 @@
 
  * Return: int
 
- * inputs: 
+ * inputs:
     send_buff: send input buffer
     send_count: number of elements to send
     send_type: data type of elements being sent
  * Descrp: Function realizes the allgather operation using the recursive
            doubling algorithm.
 
- * Auther: MPICH / slightly modified by Ahmad Faraj.  
+ * Author: MPICH / slightly modified by Ahmad Faraj.
 
  ****************************************************************************/
-int smpi_coll_tuned_alltoall_rdb(void *send_buff, int send_count,
-                                 MPI_Datatype send_type,
-                                 void *recv_buff, int recv_count,
-                                 MPI_Datatype recv_type, MPI_Comm comm)
+namespace simgrid{
+namespace smpi{
+int alltoall__rdb(const void *send_buff, int send_count,
+                  MPI_Datatype send_type,
+                  void *recv_buff, int recv_count,
+                  MPI_Datatype recv_type, MPI_Comm comm)
 {
   /* MPI variables */
   MPI_Status status;
@@ -41,7 +44,6 @@ int smpi_coll_tuned_alltoall_rdb(void *send_buff, int send_count,
   int last_recv_count = 0, tmp_mask, tree_root, num_procs_completed;
   int tag = COLL_TAG_ALLTOALL, mask = 1, i = 0;
 
-  char *tmp_buff;
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
 
@@ -56,7 +58,7 @@ int smpi_coll_tuned_alltoall_rdb(void *send_buff, int send_count,
 
   max_size = num_procs * recv_increment;
 
-  tmp_buff = (char *) smpi_get_tmp_sendbuffer(max_size);
+  unsigned char* tmp_buff = smpi_get_tmp_sendbuffer(max_size);
 
   curr_size = send_count * num_procs;
 
@@ -78,7 +80,7 @@ int smpi_coll_tuned_alltoall_rdb(void *send_buff, int send_count,
                    tmp_buff + recv_offset, mask * recv_count * num_procs,
                    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_size += last_recv_count;
     }
 
@@ -131,7 +133,7 @@ int smpi_coll_tuned_alltoall_rdb(void *send_buff, int send_count,
                    mask * num_procs * send_count, send_type, dst,
                    tag, comm, &status);
 
-          last_recv_count = smpi_mpi_get_count(&status, send_type);
+          last_recv_count = Status::get_count(&status, send_type);
           curr_size += last_recv_count;
         }
 
@@ -152,3 +154,5 @@ int smpi_coll_tuned_alltoall_rdb(void *send_buff, int send_count,
   smpi_free_tmp_buffer(tmp_buff);
   return MPI_SUCCESS;
 }
+}
+}