Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix most of spelling mistakes in src/
[simgrid.git] / src / smpi / colls / allreduce / allreduce-mvapich-two-level.cpp
index 4c206c4..23d0267 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2019. The SimGrid Team.
+/* Copyright (c) 2013-2020. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 
 #include "../colls_private.hpp"
 
-#define MPIR_Allreduce_pt2pt_rd_MV2 Coll_allreduce_rdb::allreduce
-#define MPIR_Allreduce_pt2pt_rs_MV2 Coll_allreduce_mvapich2_rs::allreduce
+#define MPIR_Allreduce_pt2pt_rd_MV2 allreduce__rdb
+#define MPIR_Allreduce_pt2pt_rs_MV2 allreduce__mvapich2_rs
 
-extern int (*MV2_Allreducection)(void *sendbuf,
+extern int (*MV2_Allreducection)(const void *sendbuf,
     void *recvbuf,
     int count,
     MPI_Datatype datatype,
     MPI_Op op, MPI_Comm comm);
 
 
-extern int (*MV2_Allreduce_intra_function)( void *sendbuf,
+extern int (*MV2_Allreduce_intra_function)(const void *sendbuf,
     void *recvbuf,
     int count,
     MPI_Datatype datatype,
@@ -56,29 +56,29 @@ extern int (*MV2_Allreduce_intra_function)( void *sendbuf,
 
 namespace simgrid{
 namespace smpi{
-static  int MPIR_Allreduce_reduce_p2p_MV2( void *sendbuf,
+static  int MPIR_Allreduce_reduce_p2p_MV2(const void *sendbuf,
     void *recvbuf,
     int count,
     MPI_Datatype datatype,
     MPI_Op op, MPI_Comm  comm)
 {
-  Colls::reduce(sendbuf,recvbuf,count,datatype,op,0,comm);
+  colls::reduce(sendbuf, recvbuf, count, datatype, op, 0, comm);
   return MPI_SUCCESS;
 }
 
-static  int MPIR_Allreduce_reduce_shmem_MV2( void *sendbuf,
+static  int MPIR_Allreduce_reduce_shmem_MV2(const void *sendbuf,
     void *recvbuf,
     int count,
     MPI_Datatype datatype,
     MPI_Op op, MPI_Comm  comm)
 {
-  Colls::reduce(sendbuf,recvbuf,count,datatype,op,0,comm);
+  colls::reduce(sendbuf, recvbuf, count, datatype, op, 0, comm);
   return MPI_SUCCESS;
 }
 
 
 /* general two level allreduce helper function */
-int Coll_allreduce_mvapich2_two_level::allreduce(void *sendbuf,
+int allreduce__mvapich2_two_level(const void *sendbuf,
                              void *recvbuf,
                              int count,
                              MPI_Datatype datatype,
@@ -92,9 +92,9 @@ int Coll_allreduce_mvapich2_two_level::allreduce(void *sendbuf,
 
     //if not set (use of the algo directly, without mvapich2 selector)
     if(MV2_Allreduce_intra_function==NULL)
-      MV2_Allreduce_intra_function = Coll_allreduce_mpich::allreduce;
+      MV2_Allreduce_intra_function = allreduce__mpich;
     if(MV2_Allreducection==NULL)
-      MV2_Allreducection = Coll_allreduce_rdb::allreduce;
+      MV2_Allreducection = allreduce__rdb;
 
     if(comm->get_leaders_comm()==MPI_COMM_NULL){
       comm->init_smp();
@@ -135,7 +135,7 @@ int Coll_allreduce_mvapich2_two_level::allreduce(void *sendbuf,
         }
 
         if (local_size != total_size) {
-          void* sendtmpbuf = (char *)smpi_get_tmp_sendbuffer(count*datatype->get_extent());
+          unsigned char* sendtmpbuf = smpi_get_tmp_sendbuffer(count * datatype->get_extent());
           Datatype::copy(recvbuf, count, datatype,sendtmpbuf, count, datatype);
             /* inter-node allreduce */
             if(MV2_Allreducection == &MPIR_Allreduce_pt2pt_rd_MV2){
@@ -164,9 +164,9 @@ int Coll_allreduce_mvapich2_two_level::allreduce(void *sendbuf,
         }
     }
 
-    /* Broadcasting the mesage from leader to the rest */
+    /* Broadcasting the message from leader to the rest */
     /* Note: shared memory broadcast could improve the performance */
-    mpi_errno = Colls::bcast(recvbuf, count, datatype, 0, shmem_comm);
+    mpi_errno = colls::bcast(recvbuf, count, datatype, 0, shmem_comm);
 
     return (mpi_errno);