Teuchos Package Browser (Single Doxygen Collection) Version of the Day
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
Teuchos::MPIComm Class Reference

Object-oriented wrapper for an MPI communicator. More...

#include <Teuchos_MPIComm.hpp>

List of all members.

Public Member Functions

 MPIComm ()
 Empty constructor builds an object for MPI_COMM_WORLD.
int getRank () const
 Return process rank.
int getNProc () const
 Return number of processors in the communicator.
void synchronize () const
 Synchronize all the processors in the communicator.

Static Public Member Functions

static MPICommworld ()
 Get an object representing MPI_COMM_WORLD.
static MPICommself ()
 Get an object representing MPI_COMM_SELF.
static void errCheck (int errCode, const std::string &methodName)

Private Member Functions

void init ()
 Common initialization function, called by all constructors.
int mpiIsRunning () const
 Indicate whether MPI is currently running.

Private Attributes

int nProc_
int myRank_

Collective communications

void allToAll (void *sendBuf, int sendCount, int sendType, void *recvBuf, int recvCount, int recvType) const
 All-to-all gather-scatter.
void allToAllv (void *sendBuf, int *sendCount, int *sendDisplacements, int sendType, void *recvBuf, int *recvCount, int *recvDisplacements, int recvType) const
 Variable-length gather-scatter.
void allReduce (void *input, void *result, int inputCount, int type, int op) const
 Do a collective operation, scattering the results to all processors.
void gather (void *sendBuf, int sendCount, int sendType, void *recvBuf, int recvCount, int recvType, int root) const
 Gather to root.
void gatherv (void *sendBuf, int sendCount, int sendType, void *recvBuf, int *recvCount, int *displacements, int recvType, int root) const
 Gather variable-sized arrays to root.
void allGather (void *sendBuf, int sendCount, int sendType, void *recvBuf, int recvCount, int recvType) const
 Gather to all processors.
void allGatherv (void *sendBuf, int sendCount, int sendType, void *recvBuf, int *recvCount, int *recvDisplacements, int recvType) const
 Variable-length gather to all processors.
void bcast (void *msg, int length, int type, int src) const
 Broadcast.

Data types

static const int INT = 1
 Integer data type.
static const int FLOAT = 2
 Float data type.
static const int DOUBLE = 3
 Double data type.
static const int DOUBLE_INT = 4
 Double/int structdata type.
static const int CHAR = 5
 Character data type.

Operations

static const int SUM = 6
 Summation operation.
static const int MIN = 7
 Minimize operation.
static const int MAX = 8
 Maximize operation.
static const int MINLOC = 8
 Minimize operation.
static const int MAXLOC = 10
 Maximize operation.
static const int PROD = 11
 Dot-product (Multiplication) operation.

Detailed Description

Object-oriented wrapper for an MPI communicator.

Warning:
This class is DEPRECATED. Please use Teuchos::Comm instead.

At present, groups are not implemented so the only communicator is MPI_COMM_WORLD.

Definition at line 72 of file Teuchos_MPIComm.hpp.


Constructor & Destructor Documentation

MPIComm::MPIComm ( )

Empty constructor builds an object for MPI_COMM_WORLD.

Definition at line 69 of file Teuchos_MPIComm.cpp.


Member Function Documentation

MPIComm & MPIComm::world ( ) [static]

Get an object representing MPI_COMM_WORLD.

Definition at line 163 of file Teuchos_MPIComm.cpp.

MPIComm & MPIComm::self ( ) [static]

Get an object representing MPI_COMM_SELF.

Definition at line 170 of file Teuchos_MPIComm.cpp.

int Teuchos::MPIComm::getRank ( ) const [inline]

Return process rank.

Definition at line 90 of file Teuchos_MPIComm.hpp.

int Teuchos::MPIComm::getNProc ( ) const [inline]

Return number of processors in the communicator.

Definition at line 93 of file Teuchos_MPIComm.hpp.

void MPIComm::synchronize ( ) const

Synchronize all the processors in the communicator.

Definition at line 181 of file Teuchos_MPIComm.cpp.

void MPIComm::allToAll ( void *  sendBuf,
int  sendCount,
int  sendType,
void *  recvBuf,
int  recvCount,
int  recvType 
) const

All-to-all gather-scatter.

Definition at line 200 of file Teuchos_MPIComm.cpp.

void MPIComm::allToAllv ( void *  sendBuf,
int *  sendCount,
int *  sendDisplacements,
int  sendType,
void *  recvBuf,
int *  recvCount,
int *  recvDisplacements,
int  recvType 
) const

Variable-length gather-scatter.

Definition at line 233 of file Teuchos_MPIComm.cpp.

void MPIComm::allReduce ( void *  input,
void *  result,
int  inputCount,
int  type,
int  op 
) const

Do a collective operation, scattering the results to all processors.

Definition at line 401 of file Teuchos_MPIComm.cpp.

void MPIComm::gather ( void *  sendBuf,
int  sendCount,
int  sendType,
void *  recvBuf,
int  recvCount,
int  recvType,
int  root 
) const

Gather to root.

Definition at line 269 of file Teuchos_MPIComm.cpp.

void MPIComm::gatherv ( void *  sendBuf,
int  sendCount,
int  sendType,
void *  recvBuf,
int *  recvCount,
int *  displacements,
int  recvType,
int  root 
) const

Gather variable-sized arrays to root.

Definition at line 296 of file Teuchos_MPIComm.cpp.

void MPIComm::allGather ( void *  sendBuf,
int  sendCount,
int  sendType,
void *  recvBuf,
int  recvCount,
int  recvType 
) const

Gather to all processors.

Definition at line 322 of file Teuchos_MPIComm.cpp.

void MPIComm::allGatherv ( void *  sendBuf,
int  sendCount,
int  sendType,
void *  recvBuf,
int *  recvCount,
int *  recvDisplacements,
int  recvType 
) const

Variable-length gather to all processors.

Definition at line 350 of file Teuchos_MPIComm.cpp.

void MPIComm::bcast ( void *  msg,
int  length,
int  type,
int  src 
) const

Broadcast.

Definition at line 380 of file Teuchos_MPIComm.cpp.

static void Teuchos::MPIComm::errCheck ( int  errCode,
const std::string &  methodName 
) [static]
void MPIComm::init ( ) [private]

Common initialization function, called by all constructors.

Definition at line 96 of file Teuchos_MPIComm.cpp.

int MPIComm::mpiIsRunning ( ) const [private]

Indicate whether MPI is currently running.

Definition at line 87 of file Teuchos_MPIComm.cpp.


Member Data Documentation

const int Teuchos::MPIComm::INT = 1 [static]

Integer data type.

Definition at line 149 of file Teuchos_MPIComm.hpp.

const int Teuchos::MPIComm::FLOAT = 2 [static]

Float data type.

Definition at line 151 of file Teuchos_MPIComm.hpp.

const int Teuchos::MPIComm::DOUBLE = 3 [static]

Double data type.

Definition at line 153 of file Teuchos_MPIComm.hpp.

const int Teuchos::MPIComm::DOUBLE_INT = 4 [static]

Double/int structdata type.

Definition at line 155 of file Teuchos_MPIComm.hpp.

const int Teuchos::MPIComm::CHAR = 5 [static]

Character data type.

Definition at line 157 of file Teuchos_MPIComm.hpp.

const int Teuchos::MPIComm::SUM = 6 [static]

Summation operation.

Definition at line 163 of file Teuchos_MPIComm.hpp.

const int Teuchos::MPIComm::MIN = 7 [static]

Minimize operation.

Definition at line 165 of file Teuchos_MPIComm.hpp.

const int Teuchos::MPIComm::MAX = 8 [static]

Maximize operation.

Definition at line 167 of file Teuchos_MPIComm.hpp.

const int Teuchos::MPIComm::MINLOC = 8 [static]

Minimize operation.

Definition at line 169 of file Teuchos_MPIComm.hpp.

const int Teuchos::MPIComm::MAXLOC = 10 [static]

Maximize operation.

Definition at line 171 of file Teuchos_MPIComm.hpp.

const int Teuchos::MPIComm::PROD = 11 [static]

Dot-product (Multiplication) operation.

Definition at line 173 of file Teuchos_MPIComm.hpp.

int Teuchos::MPIComm::nProc_ [private]

Definition at line 192 of file Teuchos_MPIComm.hpp.

Definition at line 193 of file Teuchos_MPIComm.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines