ALPSCore reference
Classes | Enumerations | Functions
alps::mpi Namespace Reference

Classes

class  communicator
 Encapsulation of an MPI communicator and some communicator-related operations. More...
 
class  environment
 MPI environment RAII class. More...
 
struct  failed_operation
 
class  is_mpi_op
 Trait for MPI reduction operations. More...
 
class  is_mpi_op< maximum< T >, T >
 Trait for MPI reduction operations: specialization for maximum. More...
 
class  is_mpi_op< std::plus< T >, T >
 Trait for MPI reduction operations: specialization for addition. More...
 
class  maximum
 Class-holder for reduction operations (and a functor) for type T. More...
 

Enumerations

enum  comm_create_kind { comm_attach, comm_duplicate, take_ownership }
 Possible ways to make a C++ object from MPI communicator. More...
 

Functions

template<typename T >
void broadcast (const communicator &comm, T *vals, std::size_t count, int root)
 Broadcasts array vals of a primitive type T, length count on communicator comm with root root More...
 
void broadcast (const communicator &comm, bool *vals, std::size_t count, int root)
 MPI_BCast of an array: overload for bool. More...
 
template<typename T >
void broadcast (const communicator &comm, std::complex< T > *vals, std::size_t count, int root)
 MPI_BCast of an array: overload for std::complex. More...
 
template<typename T >
void broadcast (const communicator &comm, T &val, int root)
 Broadcasts value val of a primitive type T on communicator comm with root root More...
 
void broadcast (const communicator &comm, std::string &val, int root)
 MPI_BCast of a single value: overload for std::string More...
 
template<typename T >
MPI_Datatype get_mpi_datatype (const T &)
 Returns MPI datatype for the value of type T More...
 
template<typename T >
void all_gather (const communicator &comm, const T &in_val, std::vector< T > &out_vals)
 performs MPI_Allgather() for primitive type T More...
 
template<typename T , typename OP >
void all_reduce (const alps::mpi::communicator &comm, const T *val, int n, T *out_val, const OP &)
 Performs MPI_Allreduce for array of a primitive type, T[n]. More...
 
template<typename T , typename OP >
void all_reduce (const alps::mpi::communicator &comm, const T &val, T &out_val, const OP &op)
 Performs MPI_Allreduce for a primitive type T. More...
 
template<typename T , typename OP >
all_reduce (const alps::mpi::communicator &comm, const T &val, const OP &op)
 Performs MPI_Allreduce for a primitive type T. More...
 
template<typename K , typename V >
void broadcast (const communicator &comm, std::map< K, V > &a_map, int root)
 MPI_BCast of an std::map. More...
 
template<typename T >
void broadcast (const communicator &comm, boost::optional< T > &val, int root)
 MPI_BCast of a boost::optional. More...
 
template<typename T >
void broadcast (const alps::mpi::communicator &comm, std::pair< std::string, T > &val, int root)
 MPI_BCast of a pair. More...
 
void broadcast (const communicator &comm, std::vector< std::string > &vec, int root)
 MPI_BCast of a vector of strings. More...
 
template<typename T >
void broadcast (const communicator &comm, std::vector< T > &vec, int root)
 MPI_BCast of a vector of (primitive) type T. More...
 
void broadcast (const communicator &comm, std::vector< bool > &vec, int root)
 MPI_BCast of a vector of bool. More...
 
void broadcast (const alps::mpi::communicator &, alps::params_ns::detail::None &, int)
 
template<typename MPLSEQ >
void broadcast (const communicator &comm, typename boost::make_variant_over< MPLSEQ >::type &var, int root)
 MPI_BCast of an boost::variant over MPL type sequence MPLSEQ. More...
 
void checked (int retcode)
 
bool is_intercomm (const communicator &comm)
 

Enumeration Type Documentation

Possible ways to make a C++ object from MPI communicator.

Enumerator
comm_attach 

do not destroy when going out of scope

comm_duplicate 

duplicate and destroy when going out of scope

take_ownership 

do not duplicate, but destroy when going out of scope

Definition at line 92 of file mpi.hpp.

Function Documentation

template<typename T >
void alps::mpi::all_gather ( const communicator comm,
const T &  in_val,
std::vector< T > &  out_vals 
)

performs MPI_Allgather() for primitive type T

Note
Vector out_vals is resized

Definition at line 326 of file mpi.hpp.

template<typename T , typename OP >
void alps::mpi::all_reduce ( const alps::mpi::communicator comm,
const T *  val,
int  n,
T *  out_val,
const OP &   
)

Performs MPI_Allreduce for array of a primitive type, T[n].

Definition at line 366 of file mpi.hpp.

template<typename T , typename OP >
void alps::mpi::all_reduce ( const alps::mpi::communicator comm,
const T &  val,
T &  out_val,
const OP &  op 
)

Performs MPI_Allreduce for a primitive type T.

Definition at line 382 of file mpi.hpp.

template<typename T , typename OP >
T alps::mpi::all_reduce ( const alps::mpi::communicator comm,
const T &  val,
const OP &  op 
)

Performs MPI_Allreduce for a primitive type T.

Definition at line 390 of file mpi.hpp.

template<typename T >
void alps::mpi::broadcast ( const communicator comm,
boost::optional< T > &  val,
int  root 
)
inline

MPI_BCast of a boost::optional.

Definition at line 24 of file mpi_optional.hpp.

template<typename K , typename V >
void alps::mpi::broadcast ( const communicator comm,
std::map< K, V > &  a_map,
int  root 
)
inline

MPI_BCast of an std::map.

Todo:
FIXME: does a series of broadcasts

Definition at line 26 of file mpi_map.hpp.

void alps::mpi::broadcast ( const alps::mpi::communicator ,
alps::params_ns::detail::None &  ,
int   
)
inline

Definition at line 27 of file mpi_variant.hpp.

template<typename T >
void alps::mpi::broadcast ( const alps::mpi::communicator comm,
std::pair< std::string, T > &  val,
int  root 
)
inline

MPI_BCast of a pair.

Definition at line 28 of file mpi_pair.hpp.

void alps::mpi::broadcast ( const communicator comm,
std::vector< std::string > &  vec,
int  root 
)
inline

MPI_BCast of a vector of strings.

Definition at line 29 of file mpi_vector.hpp.

template<typename T >
void alps::mpi::broadcast ( const communicator comm,
std::vector< T > &  vec,
int  root 
)
inline

MPI_BCast of a vector of (primitive) type T.

Definition at line 49 of file mpi_vector.hpp.

void alps::mpi::broadcast ( const communicator comm,
std::vector< bool > &  vec,
int  root 
)
inline

MPI_BCast of a vector of bool.

Definition at line 63 of file mpi_vector.hpp.

template<typename MPLSEQ >
void alps::mpi::broadcast ( const communicator comm,
typename boost::make_variant_over< MPLSEQ >::type &  var,
int  root 
)
inline

MPI_BCast of an boost::variant over MPL type sequence MPLSEQ.

Definition at line 82 of file mpi_variant.hpp.

template<typename T >
void alps::mpi::broadcast ( const communicator comm,
T *  vals,
std::size_t  count,
int  root 
)

Broadcasts array vals of a primitive type T, length count on communicator comm with root root

Definition at line 270 of file mpi.hpp.

void alps::mpi::broadcast ( const communicator comm,
bool *  vals,
std::size_t  count,
int  root 
)
inline

MPI_BCast of an array: overload for bool.

Definition at line 276 of file mpi.hpp.

template<typename T >
void alps::mpi::broadcast ( const communicator comm,
std::complex< T > *  vals,
std::size_t  count,
int  root 
)
inline

MPI_BCast of an array: overload for std::complex.

Definition at line 286 of file mpi.hpp.

template<typename T >
void alps::mpi::broadcast ( const communicator comm,
T &  val,
int  root 
)

Broadcasts value val of a primitive type T on communicator comm with root root

Definition at line 294 of file mpi.hpp.

void alps::mpi::broadcast ( const communicator comm,
std::string &  val,
int  root 
)
inline

MPI_BCast of a single value: overload for std::string

Definition at line 301 of file mpi.hpp.

void alps::mpi::checked ( int  retcode)
inline

Definition at line 16 of file mpi.hpp.

template<typename T >
MPI_Datatype alps::mpi::get_mpi_datatype ( const T &  )

Returns MPI datatype for the value of type T

Definition at line 319 of file mpi.hpp.

bool alps::mpi::is_intercomm ( const communicator comm)
inline

Definition at line 22 of file mpi.hpp.