Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use type bool for boolean variables in smpi/colls/.
[simgrid.git] / src / smpi / colls / gather / gather-mvapich.cpp
index adeb3ce..5eb527f 100644 (file)
@@ -38,9 +38,9 @@
 #include "../colls_private.hpp"
 #include <algorithm>
 
-#define MPIR_Gather_MV2_Direct Coll_gather_ompi_basic_linear::gather
-#define MPIR_Gather_MV2_two_level_Direct Coll_gather_ompi_basic_linear::gather
-#define MPIR_Gather_intra Coll_gather_mpich::gather
+#define MPIR_Gather_MV2_Direct gather__ompi_basic_linear
+#define MPIR_Gather_MV2_two_level_Direct gather__ompi_basic_linear
+#define MPIR_Gather_intra gather__mpich
 typedef int (*MV2_Gather_function_ptr) (const void *sendbuf,
     int sendcnt,
     MPI_Datatype sendtype,
@@ -52,9 +52,8 @@ typedef int (*MV2_Gather_function_ptr) (const void *sendbuf,
 extern MV2_Gather_function_ptr MV2_Gather_inter_leader_function;
 extern MV2_Gather_function_ptr MV2_Gather_intra_node_function;
 
-#define TEMP_BUF_HAS_NO_DATA (0)
-#define TEMP_BUF_HAS_DATA (1)
-
+#define TEMP_BUF_HAS_NO_DATA (false)
+#define TEMP_BUF_HAS_DATA (true)
 
 namespace simgrid{
 namespace smpi{
@@ -80,13 +79,9 @@ namespace smpi{
  *                      intra node gather function
  * errflag           - (out) to record errors
  */
-static int MPIR_pt_pt_intra_gather( const void *sendbuf, int sendcnt, MPI_Datatype sendtype,
-                            void *recvbuf, int recvcnt, MPI_Datatype recvtype,
-                            int root, int rank,
-                            void *tmp_buf, int nbytes,
-                            int is_data_avail,
-                            MPI_Comm comm,
-                            MV2_Gather_function_ptr intra_node_fn_ptr)
+static int MPIR_pt_pt_intra_gather(const void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt,
+                                   MPI_Datatype recvtype, int root, int rank, void* tmp_buf, int nbytes,
+                                   bool is_data_avail, MPI_Comm comm, MV2_Gather_function_ptr intra_node_fn_ptr)
 {
     int mpi_errno = MPI_SUCCESS;
     MPI_Aint recvtype_extent = 0;  /* Datatype extent */
@@ -127,14 +122,14 @@ static int MPIR_pt_pt_intra_gather( const void *sendbuf, int sendcnt, MPI_Dataty
 
 
 
-int Coll_gather_mvapich2_two_level::gather(const void *sendbuf,
-                                            int sendcnt,
-                                            MPI_Datatype sendtype,
-                                            void *recvbuf,
-                                            int recvcnt,
-                                            MPI_Datatype recvtype,
-                                            int root,
-                                            MPI_Comm comm)
+int gather__mvapich2_two_level(const void *sendbuf,
+                               int sendcnt,
+                               MPI_Datatype sendtype,
+                               void *recvbuf,
+                               int recvcnt,
+                               MPI_Datatype recvtype,
+                               int root,
+                               MPI_Comm comm)
 {
   unsigned char* leader_gather_buf = NULL;
   int comm_size, rank;
@@ -151,7 +146,7 @@ int Coll_gather_mvapich2_two_level::gather(const void *sendbuf,
 
   // if not set (use of the algo directly, without mvapich2 selector)
   if (MV2_Gather_intra_node_function == NULL)
-    MV2_Gather_intra_node_function = Coll_gather_mpich::gather;
+    MV2_Gather_intra_node_function = gather__mpich;
 
   if (comm->get_leaders_comm() == MPI_COMM_NULL) {
     comm->init_smp();
@@ -318,7 +313,7 @@ int Coll_gather_mvapich2_two_level::gather(const void *sendbuf,
               recvcnts[i] = node_sizes[i] * recvcnt;
             }
           }
-          Colls::gatherv(tmp_buf, local_size * nbytes, MPI_BYTE, recvbuf, recvcnts, displs, recvtype, leader_root,
+          colls::gatherv(tmp_buf, local_size * nbytes, MPI_BYTE, recvbuf, recvcnts, displs, recvtype, leader_root,
                          leader_comm);
         } else {
           /* The root of the gather operation is not the node leader.
@@ -333,7 +328,7 @@ int Coll_gather_mvapich2_two_level::gather(const void *sendbuf,
               recvcnts[i] = node_sizes[i] * nbytes;
             }
           }
-          Colls::gatherv(tmp_buf, local_size * nbytes, MPI_BYTE, leader_gather_buf, recvcnts, displs, MPI_BYTE,
+          colls::gatherv(tmp_buf, local_size * nbytes, MPI_BYTE, leader_gather_buf, recvcnts, displs, MPI_BYTE,
                          leader_root, leader_comm);
         }
         if (leader_comm_rank == leader_root) {