ALPSCore reference
Classes | Namespaces | Enumerations | Functions
mpi.hpp File Reference

Header for object-oriented interface to MPI (similar to boost::mpi) More...

#include <mpi.h>
#include <vector>
#include <complex>
#include <exception>
#include <functional>
#include <algorithm>
#include <memory>
#include <stdexcept>
#include <typeinfo>
Include dependency graph for mpi.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

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

Namespaces

 alps
 
 alps::mpi
 

Enumerations

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

Functions

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 More...
 
void alps::mpi::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 alps::mpi::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 alps::mpi::broadcast (const communicator &comm, T &val, int root)
 Broadcasts value val of a primitive type T on communicator comm with root root More...
 
void alps::mpi::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 alps::mpi::get_mpi_datatype (const T &)
 Returns MPI datatype for the value of type T More...
 
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 More...
 
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]. More...
 
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. More...
 
template<typename T , typename OP >
alps::mpi::all_reduce (const alps::mpi::communicator &comm, const T &val, const OP &op)
 Performs MPI_Allreduce for a primitive type T. More...
 

Detailed Description

Header for object-oriented interface to MPI (similar to boost::mpi)

The interface provided by this file is intended to be (almost) drop-in replacemnt for the subset of boost::mpi functionality used by ALPSCore.

Definition in file mpi.hpp.