Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines with new year.
[simgrid.git] / src / smpi / colls / reduce_scatter / reduce_scatter-mpich.cpp
index 3679390..1aa22b3 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
@@ -24,24 +24,21 @@ static inline int MPIU_Mirror_permutation(unsigned int x, int bits)
 namespace simgrid{
 namespace smpi{
 
-int Coll_reduce_scatter_mpich_pair::reduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts[],
-                              MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
+int reduce_scatter__mpich_pair(const void *sendbuf, void *recvbuf, const int recvcounts[],
+                               MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
 {
     int   rank, comm_size, i;
     MPI_Aint extent, true_extent, true_lb;
     unsigned char* tmp_recvbuf;
     int mpi_errno = MPI_SUCCESS;
     int total_count, dst, src;
-    int is_commutative;
     comm_size = comm->size();
     rank = comm->rank();
 
     extent =datatype->get_extent();
     datatype->extent(&true_lb, &true_extent);
 
-    if (op->is_commutative()) {
-        is_commutative = 1;
-    }
+    bool is_commutative = (op == MPI_OP_NULL || op->is_commutative());
 
     int* disps = new int[comm_size];
 
@@ -144,8 +141,8 @@ int Coll_reduce_scatter_mpich_pair::reduce_scatter(const void *sendbuf, void *re
 }
 
 
-int Coll_reduce_scatter_mpich_noncomm::reduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts[],
-                              MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
+int reduce_scatter__mpich_noncomm(const void *sendbuf, void *recvbuf, const int recvcounts[],
+                                  MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
 {
     int mpi_errno = MPI_SUCCESS;
     int comm_size = comm->size() ;
@@ -264,7 +261,7 @@ int Coll_reduce_scatter_mpich_noncomm::reduce_scatter(const void *sendbuf, void
 
 
 
-int Coll_reduce_scatter_mpich_rdb::reduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts[],
+int reduce_scatter__mpich_rdb(const void *sendbuf, void *recvbuf, const int recvcounts[],
                               MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
 {
     int   rank, comm_size, i;
@@ -274,16 +271,14 @@ int Coll_reduce_scatter_mpich_rdb::reduce_scatter(const void *sendbuf, void *rec
     int mask, dst_tree_root, my_tree_root, j, k;
     int received;
     MPI_Datatype sendtype, recvtype;
-    int nprocs_completed, tmp_mask, tree_root, is_commutative=0;
+    int nprocs_completed, tmp_mask, tree_root;
     comm_size = comm->size();
     rank = comm->rank();
 
     extent =datatype->get_extent();
     datatype->extent(&true_lb, &true_extent);
 
-    if ((op==MPI_OP_NULL) || op->is_commutative()) {
-        is_commutative = 1;
-    }
+    bool is_commutative = (op == MPI_OP_NULL || op->is_commutative());
 
     int* disps = new int[comm_size];