3 #ifndef DUNE_COLLECTIVECOMMUNICATION_HH 4 #define DUNE_COLLECTIVECOMMUNICATION_HH 78 template<
typename Communicator>
120 int sum (T* inout,
int len)
const 142 int prod (T* inout,
int len)
const 164 int min (T* inout,
int len)
const 186 int max (T* inout,
int len)
const 226 int gather (
const T* in, T* out,
int len,
int root)
const 229 for (
int i=0; i<len; i++)
254 int gatherv (
const T* in,
int sendlen, T* out,
int* recvlen,
int* displ,
int root)
const 258 for (
int i=*displ; i<sendlen; i++)
277 int scatter (
const T* send, T* recv,
int len,
int root)
const 280 for (
int i=0; i<len; i++)
304 int scatterv (
const T* send,
int* sendlen,
int* displ, T* recv,
int recvlen,
int root)
const 308 for (
int i=*displ; i<*sendlen; i++)
329 for(
const T* end=sbuf+count; sbuf < end; ++sbuf, ++rbuf)
351 int allgatherv (
const T* in,
int sendlen, T* out,
int* recvlen,
int* displ)
const 354 for (
int i=*displ; i<sendlen; i++)
371 template<
typename BinaryFunction,
typename Type>
392 template<
typename BinaryFunction,
typename Type>
393 void allreduce(
const Type* in, Type* out,
int len)
const 395 std::copy(in, in+len, out);
CollectiveCommunication()
Construct default object.
Definition: collectivecommunication.hh:83
int scatterv(const T *send, int *sendlen, int *displ, T *recv, int recvlen, int root) const
Scatter arrays of variable length from a root to all other tasks.
Definition: collectivecommunication.hh:304
#define DUNE_UNUSED_PARAMETER(parm)
A macro to mark intentionally unused function parameters with.
Definition: unused.hh:25
int allgatherv(const T *in, int sendlen, T *out, int *recvlen, int *displ) const
Gathers data of variable length from all tasks and distribute it to all.
Definition: collectivecommunication.hh:351
int allreduce(Type *inout, int len) const
Compute something over all processes for each component of an array and return the result in every pr...
Definition: collectivecommunication.hh:372
Definition of the DUNE_UNUSED macro for the case that config.h is not available.
T prod(const T &in) const
Compute the product of the argument over all processes and return the result in every process...
Definition: collectivecommunication.hh:131
int barrier() const
Wait until all processes have arrived at this point in the program.
Definition: collectivecommunication.hh:196
Collective communication interface and sequential default implementation.
Definition: collectivecommunication.hh:79
CollectiveCommunication(const Communicator &)
Constructor with a given communicator.
Definition: collectivecommunication.hh:90
int allgather(const T *sbuf, int count, T *rbuf) const
Gathers data from all tasks and distribute it to all.
Definition: collectivecommunication.hh:327
A few common exception classes.
Dune namespace.
Definition: alignedallocator.hh:9
int size() const
Number of processes in set, is greater than 0.
Definition: collectivecommunication.hh:100
Various helper classes derived from from std::binary_function for stl-style functional programming...
int min(T *inout, int len) const
Compute the minimum over all processes for each component of an array and return the result in every ...
Definition: collectivecommunication.hh:164
int broadcast(T *inout, int len, int root) const
Distribute an array from the process with rank root to all other processes.
Definition: collectivecommunication.hh:205
void allreduce(const Type *in, Type *out, int len) const
Compute something over all processes for each component of an array and return the result in every pr...
Definition: collectivecommunication.hh:393
int gather(const T *in, T *out, int len, int root) const
Gather arrays on root task.
Definition: collectivecommunication.hh:226
T sum(const T &in) const
Compute the sum of the argument over all processes and return the result in every process...
Definition: collectivecommunication.hh:109
Definition: collectivecommunication.hh:43
T min(const T &in) const
Compute the minimum of the argument over all processes and return the result in every process...
Definition: collectivecommunication.hh:153
int rank() const
Return rank, is between 0 and size()-1.
Definition: collectivecommunication.hh:94
int sum(T *inout, int len) const
Compute the sum over all processes for each component of an array and return the result in every proc...
Definition: collectivecommunication.hh:120
int max(T *inout, int len) const
Compute the maximum over all processes for each component of an array and return the result in every ...
Definition: collectivecommunication.hh:186
T max(const T &in) const
Compute the maximum of the argument over all processes and return the result in every process...
Definition: collectivecommunication.hh:175
int scatter(const T *send, T *recv, int len, int root) const
Scatter array from a root to all other task.
Definition: collectivecommunication.hh:277
int prod(T *inout, int len) const
Compute the product over all processes for each component of an array and return the result in every ...
Definition: collectivecommunication.hh:142
int gatherv(const T *in, int sendlen, T *out, int *recvlen, int *displ, int root) const
Gather arrays of variable size on root task.
Definition: collectivecommunication.hh:254