ALPSCore reference
Classes | Public Member Functions | List of all members
alps::mpi::communicator Class Reference

Encapsulation of an MPI communicator and some communicator-related operations. More...

#include <mpi.hpp>

Collaboration diagram for alps::mpi::communicator:
Collaboration graph

Public Member Functions

 communicator ()
 Creates an MPI_COMM_WORLD communicator object. More...
 
 communicator (const MPI_Comm &comm, comm_create_kind kind)
 Creates a communicator object from an MPI communicator. More...
 
int rank () const
 Returns process rank in this communicator. More...
 
int size () const
 Returns the number of processes in this communicator. More...
 
void barrier () const
 Barrier on this communicator. More...
 
 operator MPI_Comm () const
 Converts this communicator object to MPI communicator. More...
 

Detailed Description

Encapsulation of an MPI communicator and some communicator-related operations.

A communicator object can be created from an existing MPI communicator, either by simple wrapping, by duplicating, or by taking complete ownership (see communicator(const MPI_Comm&, comm_create_kind)).

Some MPI operations are implemented as mthods of this class. Many ALPSCore classes have broadcast() methods that take the communicator object as an argument. The communicator object is implicitly convertible to the wrapped MPI communicator and therefore can be used as an argument to MPI calls directly.

Definition at line 111 of file mpi.hpp.

Constructor & Destructor Documentation

alps::mpi::communicator::communicator ( )
inline

Creates an MPI_COMM_WORLD communicator object.

Definition at line 127 of file mpi.hpp.

alps::mpi::communicator::communicator ( const MPI_Comm &  comm,
comm_create_kind  kind 
)
inline

Creates a communicator object from an MPI communicator.

Parameters
commMPI communicator
kindHow to manage the communicator (see alps::mpi::comm_create_kind)

Definition at line 136 of file mpi.hpp.

Member Function Documentation

void alps::mpi::communicator::barrier ( ) const
inline

Barrier on this communicator.

Definition at line 170 of file mpi.hpp.

alps::mpi::communicator::operator MPI_Comm ( ) const
inline

Converts this communicator object to MPI communicator.

Definition at line 175 of file mpi.hpp.

int alps::mpi::communicator::rank ( ) const
inline

Returns process rank in this communicator.

Definition at line 156 of file mpi.hpp.

int alps::mpi::communicator::size ( ) const
inline

Returns the number of processes in this communicator.

Definition at line 163 of file mpi.hpp.


The documentation for this class was generated from the following file: