1#ifndef MPI_COMMUNICATOR_DEFINED
2#define MPI_COMMUNICATOR_DEFINED
29 void reduce(
const F &src, F &dst,
int rootRank = 0) {
55 gather(
const std::vector<F> &src, std::vector<F> &dst,
int rootRank = 0) {
56 if (
rank == rootRank) {
61 MPI_Gather(src.data(),
114template <
typename F,
int D>
Definition MpiCommunicator.hpp:14
int getRank() const
Definition MpiCommunicator.hpp:71
void reduce(const F &src, F &dst, int rootRank=0)
Definition MpiCommunicator.hpp:29
MpiCommunicator(const CTF::World &world)
Definition MpiCommunicator.hpp:20
void gather(const std::vector< F > &src, std::vector< F > &dst, int rootRank=0)
Definition MpiCommunicator.hpp:55
MPI_Comm comm
Definition MpiCommunicator.hpp:76
~MpiCommunicator()
Definition MpiCommunicator.hpp:24
int getProcesses() const
Definition MpiCommunicator.hpp:72
MpiCommunicator(int rank_, int processes_, MPI_Comm comm_=MPI_COMM_WORLD)
Definition MpiCommunicator.hpp:16
void barrier()
Definition MpiCommunicator.hpp:26
int rank
Definition MpiCommunicator.hpp:75
int processes
Definition MpiCommunicator.hpp:75
void allReduce(const F &src, F &dst)
Definition MpiCommunicator.hpp:40
static MPI_Datatype elementType()
Definition MpiCommunicator.hpp:117
static int elementCount()
Definition MpiCommunicator.hpp:118
static int elementCount()
Definition MpiCommunicator.hpp:111
static MPI_Datatype elementType()
Definition MpiCommunicator.hpp:110
static MPI_Datatype elementType()
Definition MpiCommunicator.hpp:103
static int elementCount()
Definition MpiCommunicator.hpp:104
static int elementCount()
Definition MpiCommunicator.hpp:90
static MPI_Datatype elementType()
Definition MpiCommunicator.hpp:89
static MPI_Datatype elementType()
Definition MpiCommunicator.hpp:82
static int elementCount()
Definition MpiCommunicator.hpp:83
static int elementCount()
Definition MpiCommunicator.hpp:97
static MPI_Datatype elementType()
Definition MpiCommunicator.hpp:96
Definition MpiCommunicator.hpp:12
Definition Algorithm.hpp:10
Complex< real > complex
Definition Complex.hpp:17