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 34 of file PlayaMPIComm.hpp.


Constructor & Destructor Documentation

Playa::MPIComm::MPIComm (  ) 

Empty constructor builds an object for MPI_COMM_WORLD.

Definition at line 18 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 300 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 149 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 183 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 219 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 246 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 55 of file PlayaMPIComm.hpp.

References nProc_.

Referenced by Playa::MPIContainerComm< T >::accumulate(), Playa::MPIContainerComm< std::string >::allGather(), Playa::MPIContainerComm< T >::allGather(), Playa::MPIContainerComm< T >::allToAll(), Sundance::BasicSimplicialMesh::assignIntermediateCellGIDs(), Sundance::Mesh::checkCellConsistency(), Sundance::Mesh::checkVertexConsistency(), Sundance::SubmaximalNodalDOFMap::computeOffsets(), Sundance::PartialElementDOFMap::computeOffsets(), Sundance::NodalDOFMapHN::computeOffsets(), Sundance::NodalDOFMap::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(), Sundance::RectangleDomain::init(), Sundance::LineDomain::init(), Playa::MassMatrix1D::init(), Playa::MatrixLaplacian1D::init(), Sundance::MixedDOFMapHN::initMap(), Sundance::MixedDOFMap::initMap(), Sundance::InhomogeneousDOFMapHN::initMap(), Playa::RandomSparseMatrixBuilder< Scalar >::initOp(), Sundance::MeshSourceBase::nProc(), Sundance::FieldWriterBase::nProc(), Sundance::PartitionedRectangleMesher::PartitionedRectangleMesher(), Playa::PoissonBoltzmannOp::PoissonBoltzmannOp(), Sundance::SpatiallyHomogeneousDOFMapBase::print(), Sundance::HomogeneousDOFMap::print(), Playa::Vector< Scalar >::print(), Sundance::UniformRefinementPair::refineTriMesh(), Sundance::BasicSimplicialMesh::resolveEdgeOwnership(), Sundance::LPTestSuite::run(), Sundance::serialPartition(), Playa::PoissonBoltzmannJacobian::setEvalPoint(), Sundance::MixedDOFMapHN::shareDOFs(), Sundance::MixedDOFMap::shareDOFs(), Sundance::InhomogeneousDOFMapHN::shareDOFs(), Sundance::HomogeneousDOFMap::shareDOFs(), Sundance::SubmaximalNodalDOFMap::shareRemoteDOFs(), Sundance::PartialElementDOFMap::shareRemoteDOFs(), Sundance::NodalDOFMapHN::shareRemoteDOFs(), Sundance::NodalDOFMap::shareRemoteDOFs(), Sundance::SubmaximalNodalDOFMap::SubmaximalNodalDOFMap(), Sundance::BasicSimplicialMesh::synchronizeNeighborLists(), and Sundance::VerboseFieldWriter::write().

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

Return process rank.

Definition at line 52 of file PlayaMPIComm.hpp.

References myRank_.

Referenced by Sundance::BasicSimplicialMesh::addFace(), Sundance::BasicSimplicialMesh::assignIntermediateCellGIDs(), Sundance::BasicSimplicialMesh::BasicSimplicialMesh(), Playa::MPIContainerComm< std::string >::bcast(), Playa::MPIContainerComm< T >::bcast(), Sundance::Mesh::checkCellConsistency(), Sundance::Mesh::checkRemoteEntity(), Sundance::Mesh::checkVertexConsistency(), Sundance::SubmaximalNodalDOFMap::computeOffsets(), Sundance::PartialElementDOFMap::computeOffsets(), Sundance::NodalDOFMapHN::computeOffsets(), Sundance::NodalDOFMap::computeOffsets(), Sundance::MixedDOFMapHN::computeOffsets(), Sundance::MixedDOFMap::computeOffsets(), Sundance::InhomogeneousDOFMapHN::computeOffsets(), Sundance::HomogeneousDOFMap::computeOffsets(), Playa::VectorTypeBase< Scalar >::createEvenlyPartitionedSpace(), Playa::MPIContainerComm< std::string >::gatherv(), Playa::HeatOperator1D::getOp(), Playa::HeatOperator1D::HeatOperator1D(), Sundance::HNMesh2D::HNMesh2D(), Sundance::HNMesh3D::HNMesh3D(), Playa::MassMatrix1D::init(), Playa::MatrixLaplacian1D::init(), Playa::RandomSparseMatrixBuilder< Scalar >::initOp(), Sundance::MeshSourceBase::myRank(), Sundance::FieldWriterBase::myRank(), Playa::PoissonBoltzmannOp::PoissonBoltzmannOp(), Sundance::SpatiallyHomogeneousDOFMapBase::print(), Sundance::HomogeneousDOFMap::print(), Playa::Vector< Scalar >::print(), Sundance::BasicSimplicialMesh::printCells(), Sundance::BasicSimplicialMesh::resolveEdgeOwnership(), Playa::Out::root(), Playa::PoissonBoltzmannJacobian::setEvalPoint(), Playa::Rand::setLocalSeed(), Sundance::MixedDOFMapHN::shareDOFs(), Sundance::MixedDOFMap::shareDOFs(), Sundance::InhomogeneousDOFMapHN::shareDOFs(), Sundance::HomogeneousDOFMap::shareDOFs(), Sundance::SubmaximalNodalDOFMap::shareRemoteDOFs(), Sundance::PartialElementDOFMap::shareRemoteDOFs(), Sundance::NodalDOFMapHN::shareRemoteDOFs(), Sundance::NodalDOFMap::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 45 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 36 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 119 of file PlayaMPIComm.cpp.

References MPIComm().

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

void Playa::MPIComm::synchronize (  )  const

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


Member Data Documentation

int Playa::MPIComm::myRank_ [private]

Definition at line 126 of file PlayaMPIComm.hpp.

Referenced by getRank(), and init().

int Playa::MPIComm::nProc_ [private]

Definition at line 125 of file PlayaMPIComm.hpp.

Referenced by getNProc(), and init().

Site Contact