Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
Playa::MPIComm Class Reference

Object representation of an MPI communicator. More...

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

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 ()
int mpiIsRunning () const

Private Attributes

int nProc_
int myRank_

Detailed Description

Object representation of an MPI communicator.

At present, groups are not implemented so the only communicators are MPI_COMM_WORLD and MPI_COMM_SELF

Definition at line 71 of file PlayaMPIComm.hpp.


Constructor & Destructor Documentation

Empty constructor builds an object for MPI_COMM_WORLD.

Definition at line 55 of file PlayaMPIComm.cpp.

References init().

Referenced by self(), and world().


Member Function Documentation

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

Variable-length gather to all processors.

Definition at line 337 of file PlayaMPIComm.cpp.

References errCheck(), mpiIsRunning(), and TEUCHOS_POLL_FOR_FAILURES.

Referenced by Playa::MPIContainerComm< std::string >::allGather().

void Playa::MPIComm::allReduce ( void *  input,
void *  result,
int  inputCount,
const MPIDataType type,
const MPIOp op 
) const
void Playa::MPIComm::allToAll ( void *  sendBuf,
int  sendCount,
const MPIDataType sendType,
void *  recvBuf,
int  recvCount,
const MPIDataType recvType 
) const

All-to-all gather-scatter.

Definition at line 186 of file PlayaMPIComm.cpp.

References errCheck(), mpiIsRunning(), and TEUCHOS_POLL_FOR_FAILURES.

Referenced by Playa::MPIContainerComm< T >::allToAll().

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

Variable-length gather-scatter.

Definition at line 220 of file PlayaMPIComm.cpp.

References errCheck(), mpiIsRunning(), and TEUCHOS_POLL_FOR_FAILURES.

Referenced by Playa::MPIContainerComm< T >::allToAll().

void Playa::MPIComm::bcast ( void *  msg,
int  length,
const MPIDataType type,
int  src 
) const
void Playa::MPIComm::errCheck ( int  errCode,
const std::string &  methodName 
) [static]
void Playa::MPIComm::gather ( void *  sendBuf,
int  sendCount,
const MPIDataType sendType,
void *  recvBuf,
int  recvCount,
const MPIDataType recvType,
int  root 
) const

Gather to root.

Definition at line 256 of file PlayaMPIComm.cpp.

References errCheck(), mpiIsRunning(), and TEUCHOS_POLL_FOR_FAILURES.

Referenced by Playa::MPIContainerComm< std::string >::gatherv().

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

Gather variable-sized arrays to root.

Definition at line 283 of file PlayaMPIComm.cpp.

References errCheck(), mpiIsRunning(), and TEUCHOS_POLL_FOR_FAILURES.

Referenced by Playa::MPIContainerComm< std::string >::gatherv().

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

Return number of processors in the communicator.

Definition at line 92 of file PlayaMPIComm.hpp.

References nProc_.

Referenced by Playa::MPIContainerComm< T >::accumulate(), Playa::MPIContainerComm< T >::allGather(), Playa::MPIContainerComm< std::string >::allGather(), Playa::MPIContainerComm< T >::allToAll(), Sundance::BasicSimplicialMesh::assignIntermediateCellGIDs(), Sundance::Mesh::checkCellConsistency(), Sundance::Mesh::checkVertexConsistency(), Sundance::NodalDOFMap::computeOffsets(), Sundance::PartialElementDOFMap::computeOffsets(), Sundance::SubmaximalNodalDOFMap::computeOffsets(), Sundance::NodalDOFMapHN::computeOffsets(), Playa::VectorTypeBase< Scalar >::createEvenlyPartitionedSpace(), Playa::MPIContainerComm< std::string >::gatherv(), Playa::HeatOperator1D::getOp(), Playa::HeatOperator1D::HeatOperator1D(), Sundance::HNMesh2D::HNMesh2D(), Sundance::HNMesh3D::HNMesh3D(), Sundance::InhomogeneousEdgeLocalizedDOFMap::InhomogeneousEdgeLocalizedDOFMap(), Sundance::InhomogeneousNodalDOFMap::InhomogeneousNodalDOFMap(), Playa::MatrixLaplacian1D::init(), Playa::MassMatrix1D::init(), Sundance::LineDomain::init(), Sundance::RectangleDomain::init(), Sundance::MixedDOFMap::initMap(), Sundance::MixedDOFMapHN::initMap(), Sundance::InhomogeneousDOFMapHN::initMap(), Playa::RandomSparseMatrixBuilder< Scalar >::initOp(), Sundance::FieldWriterBase::nProc(), Sundance::MeshSourceBase::nProc(), Sundance::PartitionedRectangleMesher::PartitionedRectangleMesher(), Playa::PoissonBoltzmannOp::PoissonBoltzmannOp(), Sundance::SpatiallyHomogeneousDOFMapBase::print(), Sundance::HomogeneousDOFMap::print(), Sundance::UniformRefinementPair::refineTriMesh(), Sundance::BasicSimplicialMesh::resolveEdgeOwnership(), Sundance::LPTestSuite::run(), Sundance::serialPartition(), Playa::PoissonBoltzmannJacobian::setEvalPoint(), Sundance::HomogeneousDOFMap::shareDOFs(), Sundance::MixedDOFMap::shareDOFs(), Sundance::MixedDOFMapHN::shareDOFs(), Sundance::InhomogeneousDOFMapHN::shareDOFs(), Sundance::NodalDOFMap::shareRemoteDOFs(), Sundance::PartialElementDOFMap::shareRemoteDOFs(), Sundance::SubmaximalNodalDOFMap::shareRemoteDOFs(), Sundance::NodalDOFMapHN::shareRemoteDOFs(), Sundance::SubmaximalNodalDOFMap::SubmaximalNodalDOFMap(), Sundance::BasicSimplicialMesh::synchronizeNeighborLists(), and Sundance::VerboseFieldWriter::write().

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

Return process rank.

Definition at line 89 of file PlayaMPIComm.hpp.

References myRank_.

Referenced by Sundance::BasicSimplicialMesh::addFace(), Sundance::Assembler::assemblyLoop(), Sundance::BasicSimplicialMesh::assignIntermediateCellGIDs(), Sundance::BasicSimplicialMesh::BasicSimplicialMesh(), Playa::MPIContainerComm< T >::bcast(), Playa::MPIContainerComm< std::string >::bcast(), Sundance::Mesh::checkCellConsistency(), Sundance::Mesh::checkRemoteEntity(), Sundance::Mesh::checkVertexConsistency(), Sundance::NodalDOFMap::computeOffsets(), Sundance::PartialElementDOFMap::computeOffsets(), Sundance::SubmaximalNodalDOFMap::computeOffsets(), Sundance::HomogeneousDOFMap::computeOffsets(), Sundance::NodalDOFMapHN::computeOffsets(), Sundance::MixedDOFMap::computeOffsets(), Sundance::MixedDOFMapHN::computeOffsets(), Sundance::InhomogeneousDOFMapHN::computeOffsets(), Playa::VectorTypeBase< Scalar >::createEvenlyPartitionedSpace(), Playa::MPIContainerComm< std::string >::gatherv(), Playa::HeatOperator1D::getOp(), Playa::HeatOperator1D::HeatOperator1D(), Sundance::HNMesh2D::HNMesh2D(), Sundance::HNMesh3D::HNMesh3D(), Playa::MatrixLaplacian1D::init(), Playa::MassMatrix1D::init(), Playa::RandomSparseMatrixBuilder< Scalar >::initOp(), Sundance::FieldWriterBase::myRank(), Sundance::MeshSourceBase::myRank(), Playa::PoissonBoltzmannOp::PoissonBoltzmannOp(), Sundance::SpatiallyHomogeneousDOFMapBase::print(), Sundance::HomogeneousDOFMap::print(), Sundance::BasicSimplicialMesh::printCells(), Sundance::BasicSimplicialMesh::resolveEdgeOwnership(), Playa::Out::root(), Playa::PoissonBoltzmannJacobian::setEvalPoint(), Playa::Rand::setLocalSeed(), Sundance::HomogeneousDOFMap::shareDOFs(), Sundance::MixedDOFMap::shareDOFs(), Sundance::MixedDOFMapHN::shareDOFs(), Sundance::InhomogeneousDOFMapHN::shareDOFs(), Sundance::NodalDOFMap::shareRemoteDOFs(), Sundance::PartialElementDOFMap::shareRemoteDOFs(), Sundance::SubmaximalNodalDOFMap::shareRemoteDOFs(), Sundance::NodalDOFMapHN::shareRemoteDOFs(), Playa::BICGSTABSolver< Scalar >::solveUnprec(), Sundance::SubmaximalNodalDOFMap::SubmaximalNodalDOFMap(), Sundance::BasicSimplicialMesh::synchronizeGIDNumbering(), Sundance::BasicSimplicialMesh::synchronizeNeighborLists(), and Sundance::VerboseFieldWriter::write().

void Playa::MPIComm::init ( ) [private]

common initialization function, called by all ctors

Definition at line 82 of file PlayaMPIComm.cpp.

References errCheck(), mpiIsRunning(), myRank_, and nProc_.

Referenced by MPIComm().

int Playa::MPIComm::mpiIsRunning ( ) const [private]

Indicate whether MPI is currently running

Definition at line 73 of file PlayaMPIComm.cpp.

Referenced by allGather(), allGatherv(), allReduce(), allToAll(), allToAllv(), bcast(), gather(), gatherv(), init(), and synchronize().

MPIComm & Playa::MPIComm::self ( ) [static]

Get an object representing MPI_COMM_SELF.

Definition at line 156 of file PlayaMPIComm.cpp.

References MPIComm().

Referenced by Playa::EpetraVectorSpace::epetraCommToTeuchosMPIComm(), and Sundance::unfoldPeriodicMesh().


Member Data Documentation

int Playa::MPIComm::myRank_ [private]

Definition at line 163 of file PlayaMPIComm.hpp.

Referenced by getRank(), and init().

int Playa::MPIComm::nProc_ [private]

Definition at line 162 of file PlayaMPIComm.hpp.

Referenced by getNProc(), and init().

Site Contact