-/* 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
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];
}
-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() ;
-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;
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];