fpmas 1.6
Classes | Functions | Variables
fpmas::communication Namespace Reference

Classes

class  MpiCommunicator
 
class  MpiCommunicatorBase
 
class  MpiCommWorld
 
struct  TypedMpi
 
struct  TypedMpi< fpmas::graph::EdgePtrWrapper< T > >
 

Functions

template<typename T , typename BinaryOp = std::plus<T>>
reduce (api::communication::TypedMpi< T > &mpi, int root, const T &data, BinaryOp binary_op=BinaryOp())
 
template<typename T , typename BinaryOp = std::plus<T>>
all_reduce (api::communication::TypedMpi< T > &mpi, const T &data, BinaryOp binary_op=BinaryOp())
 

Variables

MpiCommWorld WORLD {}
 

Detailed Description

fpmas::api::communication implementations.

Function Documentation

◆ reduce()

template<typename T , typename BinaryOp = std::plus<T>>
T fpmas::communication::reduce ( api::communication::TypedMpi< T > &  mpi,
int  root,
const T &  data,
BinaryOp  binary_op = BinaryOp() 
)

Gathers data at root using the provided mpi instance, and returns the accumulated result.

binary_op is the operation used to accumulate data of the vector returned by the gather operation.

On processes other that root, data is returned.

Parameters
mpimpi instance used to perform the gather operation
rootrank of the processes on which data should be gathered and accumulated
datalocal data instance to gather
binary_opoperation used to accumulate data
See also
fpmas::api::communication::TypedMpi::gather()
https://en.cppreference.com/w/cpp/algorithm/accumulate

◆ all_reduce()

template<typename T , typename BinaryOp = std::plus<T>>
T fpmas::communication::all_reduce ( api::communication::TypedMpi< T > &  mpi,
const T &  data,
BinaryOp  binary_op = BinaryOp() 
)

Gathers data using the provided mpi instance, and returns the accumulated result on all processes (using an fpmas::api::communication::TypedMpi::allGather() operation).

binary_op is the operation used to accumulate data of the vector returned by the gather operation.

Parameters
mpimpi instance used to perform the allGather() operation
datalocal data instance to gather
binary_opoperation used to accumulate data
See also
fpmas::api::communication::TypedMpi::allGather()
https://en.cppreference.com/w/cpp/algorithm/accumulate

Variable Documentation

◆ WORLD

MpiCommWorld fpmas::communication::WORLD {}

MpiCommWorld instance, initialized by fpmas::init().