![]() |
QMCPACK
|
Driver synchronized step context. More...
Public Types | |
using | MCPWalker = MCPopulation::MCPWalker |
using | GradType = QMCTraits::GradType |
using | RealType = QMCTraits::RealType |
using | FullPrecRealType = QMCTraits::FullPrecRealType |
Static Public Member Functions | |
static RefVector< WalkerLogCollector > | getWalkerLogCollectorRefs (const UPtrVector< Crowd > &crowds) |
get refereces of active walker log collectors. If walker logging is disabled, the RefVector size can be zero. More... | |
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... | |
std::unique_ptr< 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 96 of file Crowd.cpp.
References 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 107 of file Crowd.h.
References Crowd::estimator_manager_crowd_.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 105 of file Crowd.h.
References Crowd::walker_hamiltonians_.
|
inline |
|
inline |
Definition at line 109 of file Crowd.h.
References Crowd::driverwalker_resource_collection_.
|
static |
get refereces of active walker log collectors. If walker logging is disabled, the RefVector size can be zero.
Definition at line 106 of file Crowd.cpp.
References qmcplusplus::crowd.
Referenced by VMCBatched::run(), and DMCBatched::run().
|
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_.
void setWalkerLogCollector | ( | std::unique_ptr< WalkerLogCollector > && | collector | ) |
activate the collector
Definition at line 91 of file Crowd.cpp.
References Crowd::wlog_collector_.
|
inline |
Definition at line 111 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(), and Crowd::wlog_collector_.
void stopBlock | ( | ) |
Definition at line 89 of file Crowd.cpp.
References Crowd::estimator_manager_crowd_, and EstimatorManagerCrowd::stopBlock().
const MultiWalkerDispatchers& dispatchers_ |
|
private |
}@
Definition at line 139 of file Crowd.h.
Referenced by Crowd::Crowd(), and Crowd::getSharedResource().
|
private |
per crowd estimator manager
Definition at line 141 of file Crowd.h.
Referenced by Crowd::accumulate(), Crowd::Crowd(), Crowd::get_estimator_manager_crowd(), Crowd::startBlock(), and Crowd::stopBlock().
Definition at line 132 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 151 of file Crowd.h.
Referenced by Crowd::get_accept(), Crowd::incAccept(), and Crowd::startBlock().
|
private |
Definition at line 152 of file Crowd.h.
Referenced by Crowd::get_nonlocal_accept(), Crowd::incNonlocalAccept(), and Crowd::startBlock().
|
private |
Definition at line 150 of file Crowd.h.
Referenced by Crowd::get_reject(), Crowd::incReject(), and Crowd::startBlock().
|
private |
Definition at line 133 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 135 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 134 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 143 of file Crowd.h.
Referenced by Crowd::collectStepWalkerLog(), Crowd::setWalkerLogCollector(), and Crowd::startBlock().