![]() |
QMCPACK
|
Driver synchronized step context. More...
Public Types | |
using | MCPWalker = MCPopulation::MCPWalker |
using | GradType = QMCTraits::GradType |
using | RealType = QMCTraits::RealType |
using | FullPrecRealType = QMCTraits::FullPrecRealType |
Public Attributes | |
const MultiWalkerDispatchers & | dispatchers_ |
Private Attributes | |
Walker Vectors | |
A single index into these ordered lists constitutes a complete walker context. | |
RefVector< MCPWalker > | mcp_walkers_ |
RefVector< ParticleSet > | walker_elecs_ |
RefVector< TrialWaveFunction > | walker_twfs_ |
RefVector< QMCHamiltonian > | walker_hamiltonians_ |
DriverWalkerResourceCollection | driverwalker_resource_collection_ |
}@ More... | |
EstimatorManagerCrowd | estimator_manager_crowd_ |
per crowd estimator manager More... | |
WalkerLogCollector | wlog_collector_ |
Step State | |
Should be per walker? | |
unsigned long | n_reject_ = 0 |
unsigned long | n_accept_ = 0 |
unsigned long | n_nonlocal_accept_ = 0 |
Driver synchronized step context.
assumed to live inside the drivers scope Represents the walker contexts exlusively operated on by one concurrent "worker" context from a total population owned by a MCPopulation
TODO: Maybe construct and initialize in thread execution space doubts this is important if rank is confined to one NUMA
using GradType = QMCTraits::GradType |
using MCPWalker = MCPopulation::MCPWalker |
using RealType = QMCTraits::RealType |
Crowd | ( | EstimatorManagerNew & | emb, |
const DriverWalkerResourceCollection & | driverwalker_res, | ||
const ParticleSet & | pset, | ||
const TrialWaveFunction & | twf, | ||
const QMCHamiltonian & | hamiltonian_temp, | ||
const MultiWalkerDispatchers & | dispatchers | ||
) |
The constructor this requires all the gold elements because it constructs a valid estimator_manager_crowd and valid mw resources for the crowd.
We do not want this to be a multistep process. To do this requires temporary walker elements. You need them all because you need to aquire the crowd scope mw QMCHamiltonian resource. The Crowd retains none of these references only the now valid mw resource. Reduce coupling between walker elements fewer could be necessary.
Definition at line 16 of file Crowd.cpp.
References EstimatorManagerNew::areThereListeners(), Crowd::driverwalker_resource_collection_, Crowd::estimator_manager_crowd_, qmcplusplus::ham, DriverWalkerResourceCollection::ham_res, QMCHamiltonian::makeClone(), qmcplusplus::pset, EstimatorManagerCrowd::registerListeners(), and qmcplusplus::twf.
|
default |
|
inline |
Definition at line 81 of file Crowd.h.
References EstimatorManagerCrowd::accumulate(), Crowd::estimator_manager_crowd_, Crowd::mcp_walkers_, Crowd::size(), Crowd::walker_elecs_, Crowd::walker_hamiltonians_, and Crowd::walker_twfs_.
void addWalker | ( | MCPWalker & | walker, |
ParticleSet & | elecs, | ||
TrialWaveFunction & | twf, | ||
QMCHamiltonian & | hamiltonian | ||
) |
Definition at line 64 of file Crowd.cpp.
References Crowd::mcp_walkers_, qmcplusplus::twf, qmcplusplus::walker, Crowd::walker_elecs_, Crowd::walker_hamiltonians_, and Crowd::walker_twfs_.
|
inline |
|
inline |
|
inline |
void clearWalkers | ( | ) |
Clears all walker vectors.
Unless you are redistributing walkers to crowds don't call this. Prefer allowing the crowd lifecycle to roll. DO NOT move constructor code into here and call from constructor That is legacy "reset" pattern is considered deprecated
Definition at line 46 of file Crowd.cpp.
References Crowd::mcp_walkers_, Crowd::walker_elecs_, Crowd::walker_hamiltonians_, and Crowd::walker_twfs_.
void collectStepWalkerLog | ( | int | current_step | ) |
Collect walker log data.
Definition at line 90 of file Crowd.cpp.
References WalkerLogCollector::collect(), Crowd::mcp_walkers_, Crowd::size(), Crowd::walker_elecs_, Crowd::walker_hamiltonians_, Crowd::walker_twfs_, and Crowd::wlog_collector_.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 69 of file Crowd.h.
References Crowd::estimator_manager_crowd_.
|
inline |
Definition at line 105 of file Crowd.h.
References Crowd::estimator_manager_crowd_.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 103 of file Crowd.h.
References Crowd::walker_hamiltonians_.
|
inline |
|
inline |
Definition at line 108 of file Crowd.h.
References Crowd::driverwalker_resource_collection_.
|
inline |
|
inline |
|
inline |
|
inline |
void reserve | ( | int | crowd_size | ) |
Because so many vectors allocate them upfront.
could be premature optimization
Definition at line 55 of file Crowd.cpp.
References Crowd::mcp_walkers_, Crowd::walker_elecs_, Crowd::walker_hamiltonians_, and Crowd::walker_twfs_.
void setRNGForHamiltonian | ( | RandomBase< FullPrecRealType > & | rng | ) |
Definition at line 72 of file Crowd.cpp.
References qmcplusplus::ham, QMCHamiltonian::setRandomGenerator(), and Crowd::walker_hamiltonians_.
|
inline |
Definition at line 110 of file Crowd.h.
References Crowd::mcp_walkers_.
Referenced by Crowd::accumulate(), and Crowd::collectStepWalkerLog().
void startBlock | ( | int | steps | ) |
Definition at line 78 of file Crowd.cpp.
References Crowd::estimator_manager_crowd_, Crowd::n_accept_, Crowd::n_nonlocal_accept_, Crowd::n_reject_, EstimatorManagerCrowd::startBlock(), WalkerLogCollector::startBlock(), and Crowd::wlog_collector_.
void stopBlock | ( | ) |
Definition at line 88 of file Crowd.cpp.
References Crowd::estimator_manager_crowd_, and EstimatorManagerCrowd::stopBlock().
const MultiWalkerDispatchers& dispatchers_ |
|
private |
}@
Definition at line 135 of file Crowd.h.
Referenced by Crowd::Crowd(), and Crowd::getSharedResource().
|
private |
per crowd estimator manager
Definition at line 137 of file Crowd.h.
Referenced by Crowd::accumulate(), Crowd::Crowd(), Crowd::get_estimator_manager_crowd(), Crowd::startBlock(), and Crowd::stopBlock().
Definition at line 128 of file Crowd.h.
Referenced by Crowd::accumulate(), Crowd::addWalker(), Crowd::beginWalkers(), Crowd::clearWalkers(), Crowd::collectStepWalkerLog(), Crowd::endWalkers(), Crowd::get_walkers(), Crowd::reserve(), and Crowd::size().
|
private |
Definition at line 147 of file Crowd.h.
Referenced by Crowd::get_accept(), Crowd::incAccept(), and Crowd::startBlock().
|
private |
Definition at line 148 of file Crowd.h.
Referenced by Crowd::get_nonlocal_accept(), Crowd::incNonlocalAccept(), and Crowd::startBlock().
|
private |
Definition at line 146 of file Crowd.h.
Referenced by Crowd::get_reject(), Crowd::incReject(), and Crowd::startBlock().
|
private |
Definition at line 129 of file Crowd.h.
Referenced by Crowd::accumulate(), Crowd::addWalker(), Crowd::beginElectrons(), Crowd::clearWalkers(), Crowd::collectStepWalkerLog(), Crowd::endElectrons(), Crowd::get_walker_elecs(), and Crowd::reserve().
|
private |
Definition at line 131 of file Crowd.h.
Referenced by Crowd::accumulate(), Crowd::addWalker(), Crowd::clearWalkers(), Crowd::collectStepWalkerLog(), Crowd::get_walker_hamiltonians(), Crowd::reserve(), and Crowd::setRNGForHamiltonian().
|
private |
Definition at line 130 of file Crowd.h.
Referenced by Crowd::accumulate(), Crowd::addWalker(), Crowd::beginTrialWaveFunctions(), Crowd::clearWalkers(), Crowd::collectStepWalkerLog(), Crowd::endTrialWaveFunctions(), Crowd::get_walker_twfs(), and Crowd::reserve().
|
private |
Definition at line 139 of file Crowd.h.
Referenced by Crowd::collectStepWalkerLog(), Crowd::getWalkerLogCollector(), and Crowd::startBlock().