QMCPACK
MPIObjectBase Class Reference

Base class for any object which needs to know about a MPI communicator. More...

+ Inheritance diagram for MPIObjectBase:
+ Collaboration diagram for MPIObjectBase:

Public Types

using mpi_comm_type = Communicate::mpi_comm_type
 

Public Member Functions

 MPIObjectBase (Communicate *c)
 constructor with communicator More...
 
int rank () const
 return the rank of the communicator More...
 
int getGroupID () const
 return the group id of the communicator More...
 
Communicate * getCommunicator () const
 return myComm More...
 
Communicate & getCommRef () const
 return a TEMPORARY reference to Communicate More...
 
mpi_comm_type getMPI () const
 return MPI communicator if one wants to use MPI directly More...
 
bool is_manager () const
 return true if the rank == 0 More...
 
const std::string & getName () const
 return the name More...
 
void setName (const std::string &aname)
 

Protected Attributes

Communicate * myComm
 pointer to Communicate More...
 
std::string ClassName
 class Name More...
 
std::string myName
 name of the object More...
 

Detailed Description

Base class for any object which needs to know about a MPI communicator.

Definition at line 26 of file MPIObjectBase.h.

Member Typedef Documentation

◆ mpi_comm_type

Definition at line 29 of file MPIObjectBase.h.

Constructor & Destructor Documentation

◆ MPIObjectBase()

constructor with communicator

Definition at line 18 of file MPIObjectBase.cpp.

18 : myComm(c), ClassName("MPIObjectBase") {}
Communicate * myComm
pointer to Communicate
Definition: MPIObjectBase.h:62
std::string ClassName
class Name
Definition: MPIObjectBase.h:65

Member Function Documentation

◆ getCommRef()

Communicate& getCommRef ( ) const
inline

return a TEMPORARY reference to Communicate

Definition at line 44 of file MPIObjectBase.h.

References MPIObjectBase::myComm.

44 { return *myComm; }
Communicate * myComm
pointer to Communicate
Definition: MPIObjectBase.h:62

◆ getCommunicator()

Communicate* getCommunicator ( ) const
inline

return myComm

Definition at line 41 of file MPIObjectBase.h.

References MPIObjectBase::myComm.

Referenced by BsplineReader::BsplineReader().

41 { return myComm; }
Communicate * myComm
pointer to Communicate
Definition: MPIObjectBase.h:62

◆ getGroupID()

int getGroupID ( ) const
inline

return the group id of the communicator

Definition at line 38 of file MPIObjectBase.h.

References Communicate::getGroupID(), and MPIObjectBase::myComm.

Referenced by RadialJastrowBuilder::computeJ2uk(), RadialJastrowBuilder::createJ1(), RadialJastrowBuilder::createJ2(), and kSpaceJastrowBuilder::outputJastrow().

38 { return myComm->getGroupID(); }
int getGroupID() const
return the group id
Definition: Communicate.h:121
Communicate * myComm
pointer to Communicate
Definition: MPIObjectBase.h:62

◆ getMPI()

mpi_comm_type getMPI ( ) const
inline

return MPI communicator if one wants to use MPI directly

Definition at line 47 of file MPIObjectBase.h.

References Communicate::getMPI(), and MPIObjectBase::myComm.

47 { return myComm->getMPI(); }
Communicate * myComm
pointer to Communicate
Definition: MPIObjectBase.h:62
mpi_comm_type getMPI() const
return the Communicator ID (typically MPI_WORLD_COMM)
Definition: Communicate.h:113

◆ getName()

const std::string& getName ( ) const
inline

return the name

Definition at line 54 of file MPIObjectBase.h.

References MPIObjectBase::myName.

Referenced by BsplineReader::create_spline_set(), BsplineReader::initialize_spo2band(), and QMCDriver::putQMCInfo().

54 { return myName; }
std::string myName
name of the object
Definition: MPIObjectBase.h:67

◆ is_manager()

◆ rank()

int rank ( ) const
inline

return the rank of the communicator

Definition at line 35 of file MPIObjectBase.h.

References MPIObjectBase::myComm, and Communicate::rank().

Referenced by PWParameterSet::getEigVectorType(), and ECPotentialBuilder::useXmlFormat().

35 { return myComm->rank(); }
int rank() const
return the rank
Definition: Communicate.h:116
Communicate * myComm
pointer to Communicate
Definition: MPIObjectBase.h:62

◆ setName()

void setName ( const std::string &  aname)
inline

Definition at line 56 of file MPIObjectBase.h.

References MPIObjectBase::myName.

56 { myName = aname; }
std::string myName
name of the object
Definition: MPIObjectBase.h:67

Member Data Documentation

◆ ClassName

◆ myComm

Communicate* myComm
protected

pointer to Communicate

Todo:
use smart pointer

Definition at line 62 of file MPIObjectBase.h.

Referenced by WaveFunctionFactory::addFermionTerm(), HamiltonianFactory::addMPCPotential(), HamiltonianFactory::addPseudoPotential(), RadialOrbitalSetBuilder< SoaAtomicBasisSet< MultiFunctorAdapter< FN >, SH > >::addRadialOrbitalH5(), SPOSetBuilderFactory::addSPOSet(), EinsplineSetBuilder::AnalyzeTwists2(), EinsplineSetBuilder::bcastSortBands(), WalkerControlMPI::branch(), WalkerControl::branch(), EinsplineSetBuilder::BroadcastOrbitalInfo(), HamiltonianFactory::build(), JastrowBuilder::build_eeI(), AGPDeterminantBuilder::buildComponent(), RadialJastrowBuilder::buildComponent(), SlaterDetBuilder::buildComponent(), JastrowBuilder::buildCounting(), JastrowBuilder::buildkSpace(), ECPComponentBuilder::buildL2(), ECPComponentBuilder::buildLocal(), JastrowBuilder::buildOneBody(), ECPComponentBuilder::buildSemiLocalAndLocal(), SPOSetBuilderFactory::buildSPOSetCollection(), WaveFunctionFactory::buildTWF(), JastrowBuilder::buildTwoBody(), QMCCostFunction::checkConfigurations(), QMCCostFunctionBatched::checkConfigurations(), PWParameterSet::checkVersion(), WalkerControl::computeCurData(), QMCCostFunction::correlatedSampling(), QMCCostFunctionBatched::correlatedSampling(), LCAOrbitalBuilder::createBasisSet(), LCAOrbitalBuilder::createBasisSetH5(), RadialJastrowBuilder::createJ1(), SPOSetBuilder::createRotatedSPOSet(), SPOSetBuilder::createSPOSet(), EinsplineSetBuilder::createSPOSet(), SPOSetBuilderFactory::createSPOSetBuilder(), LCAOrbitalBuilder::createSPOSetFromXML(), LCAOSpinorBuilder::createSPOSetFromXML(), EinsplineSpinorSetBuilder::createSPOSetFromXML(), EinsplineSetBuilder::createSPOSetFromXML(), WalkerControlBase::doNotBranch(), LCAOrbitalBuilder::EvalPeriodicImagePhaseFactors(), QMCMain::execute(), QMCCostFunction::fillOverlapHamiltonianMatrices(), QMCCostFunctionBatched::fillOverlapHamiltonianMatrices(), QMCDriverNew::finalize(), QMCDriver::finalize(), MPIObjectBase::getCommRef(), MPIObjectBase::getCommunicator(), PWParameterSet::getEigVectorType(), MPIObjectBase::getGroupID(), MPIObjectBase::getMPI(), QMCCostFunction::GradCost(), QMCCostFunctionBatched::GradCost(), PWParameterSet::hasComplexData(), QMCDriverNew::initializeQMC(), MPIObjectBase::is_manager(), LCAOSpinorBuilder::LCAOSpinorBuilder(), LCAOrbitalBuilder::loadBasisSetFromH5(), LCAOSpinorBuilder::loadMO(), LCAOrbitalBuilder::loadMO(), QMCDriverNew::measureImbalance(), EinsplineSetBuilder::OccupyBands(), EinsplineSetBuilder::OccupyBands_ESHDF(), QMCFixedSampleLinearOptimizeBatched::one_shift_run(), ECPComponentBuilder::parseCasino(), QMCDriverNewTestWrapper::process(), QMCFixedSampleLinearOptimizeBatched::process(), VMCBatched::process(), DMCBatched::process(), QMCDriver::process(), QMCFixedSampleLinearOptimize::processOptXML(), QMCFixedSampleLinearOptimizeBatched::processOptXML(), QMCMain::processPWH(), VMC::put(), CSVMC::put(), ParticleSetPool::put(), WaveFunctionPool::put(), HamiltonianPool::put(), QMCFixedSampleLinearOptimize::put(), WalkerControl::put(), QMCCostFunctionBase::put(), LCAOSpinorBuilder::putFromH5(), LCAOrbitalBuilder::putFromH5(), LCAOrbitalBuilder::putPBCFromH5(), QMCDriver::putWalkers(), QMCDriverNew::putWalkers(), QMCDriverNew::QMCDriverNew(), QMCMain::QMCMain(), MPIObjectBase::rank(), ECPComponentBuilder::read_pp_file(), SlaterDetBuilder::readDetList(), EinsplineSetBuilder::ReadGvectors_ESHDF(), ParticleSetPool::readSimulationCellXML(), QMCDriverNew::recordBlock(), QMCDriver::recordBlock(), WalkerReconfigurationMPI::recvWalkers(), QMCCostFunctionBase::Report(), QMCCostFunctionBase::reportParameters(), QMCCostFunctionBase::reportParametersH5(), VMC::run(), RMC::run(), DMC::run(), CSVMC::run(), QMCFixedSampleLinearOptimize::run(), VMCBatched::run(), DMCBatched::run(), QMCMain::runQMC(), WalkerReconfigurationMPI::sendWalkers(), EinsplineSetBuilder::set_metadata(), QMCMain::setMCWalkers(), QMCDriver::setWalkerOffsets(), WalkerControl::start(), WalkerControlBase::start(), WalkerReconfigurationMPI::swapWalkers(), WalkerControlMPI::swapWalkersSimple(), QMCDriverNewTestWrapper::testAdjustGlobalWalkerCount(), ECPotentialBuilder::useXmlFormat(), QMCMain::validateXML(), and WalkerControlBase::WalkerControlBase().

◆ myName


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