![]() |
QMCPACK
|
Public Types | |
using | MCPWalker = Walker< QMCTraits, PtclOnLatticeTraits > |
using | WFBuffer = MCPWalker::WFBuffer_t |
using | RealType = QMCTraits::RealType |
using | Properties = MCPWalker::PropertyContainer_t |
using | IndexType = QMCTraits::IndexType |
using | FullPrecRealType = QMCTraits::FullPrecRealType |
using | opt_variables_type = optimize::VariableSet |
Private Attributes | |
MCDataType< QMCTraits::FullPrecRealType > | ensemble_property_ |
IndexType | num_global_walkers_ = 0 |
IndexType | num_local_walkers_ = 0 |
IndexType | max_samples_ = 0 |
IndexType | target_population_ = 0 |
IndexType | target_samples_ = 0 |
UPtrVector< MCPWalker > | walkers_ |
UPtrVector< MCPWalker > | dead_walkers_ |
std::vector< RealType > | ptclgrp_mass_ |
std::vector< RealType > | ptclgrp_inv_mass_ |
1/Mass per species More... | |
std::vector< RealType > | ptcl_inv_mass_ |
1/Mass per particle More... | |
TrialWaveFunction * | trial_wf_ |
ParticleSet * | elec_particle_set_ |
QMCHamiltonian * | hamiltonian_ |
UPtrVector< ParticleSet > | walker_elec_particle_sets_ |
UPtrVector< TrialWaveFunction > | walker_trial_wavefunctions_ |
UPtrVector< QMCHamiltonian > | walker_hamiltonians_ |
UPtrVector< ParticleSet > | dead_walker_elec_particle_sets_ |
UPtrVector< TrialWaveFunction > | dead_walker_trial_wavefunctions_ |
UPtrVector< QMCHamiltonian > | dead_walker_hamiltonians_ |
int | num_ranks_ |
int | rank_ |
Definition at line 38 of file MCPopulation.h.
Definition at line 46 of file MCPopulation.h.
using IndexType = QMCTraits::IndexType |
Definition at line 45 of file MCPopulation.h.
using MCPWalker = Walker<QMCTraits, PtclOnLatticeTraits> |
Definition at line 41 of file MCPopulation.h.
Definition at line 47 of file MCPopulation.h.
Definition at line 44 of file MCPopulation.h.
using RealType = QMCTraits::RealType |
Definition at line 43 of file MCPopulation.h.
using WFBuffer = MCPWalker::WFBuffer_t |
Definition at line 42 of file MCPopulation.h.
MCPopulation | ( | int | num_ranks, |
int | this_rank, | ||
ParticleSet * | elecs, | ||
TrialWaveFunction * | trial_wf, | ||
QMCHamiltonian * | hamiltonian_ | ||
) |
Temporary constructor to deal with MCWalkerConfiguration be the only source of some information in QMCDriverFactory.
Definition at line 23 of file MCPopulation.cpp.
References ParticleSet::first(), ParticleSet::getTotalNum(), ParticleSet::groups(), ParticleSet::last(), ParticleSet::Mass, MCPopulation::ptcl_inv_mass_, MCPopulation::ptclgrp_inv_mass_, and MCPopulation::ptclgrp_mass_.
|
default |
|
delete |
|
default |
void checkIntegrity | ( | ) | const |
}@
check if all the internal vector contain consistent sizes;
Definition at line 264 of file MCPopulation.cpp.
References MCPopulation::dead_walker_elec_particle_sets_, MCPopulation::dead_walker_hamiltonians_, MCPopulation::dead_walker_trial_wavefunctions_, MCPopulation::dead_walkers_, MCPopulation::num_local_walkers_, MCPopulation::walker_elec_particle_sets_, MCPopulation::walker_hamiltonians_, MCPopulation::walker_trial_wavefunctions_, and MCPopulation::walkers_.
Referenced by WalkerControl::branch(), and WalkerControl::killDeadWalkersOnRank().
void createWalkers | ( | IndexType | num_walkers, |
const WalkerConfigurations & | walker_configs, | ||
RealType | reserve = 1.0 |
||
) |
}@
Creates walkers with a clone of the golden electron particle set and golden trial wavefunction
[in] | num_walkers | number of living walkers in initial population |
[in] | reserve | multiple above that to reserve >=1.0 |
Definition at line 47 of file MCPopulation.cpp.
References MCPopulation::elec_particle_set_, WalkerConfigurations::getActiveWalkers(), ParticleSet::getTotalNum(), MCPopulation::hamiltonian_, MCPopulation::killLastWalker(), QMCHamiltonian::makeClone(), TrialWaveFunction::makeClone(), MCPopulation::num_local_walkers_, MCPopulation::num_ranks_, qmcplusplus::hdf::num_walkers, outputManager, OutputManagerClass::pause(), ParticleSet::Properties, ParticleSet::PropertyList, ParticleSet::R, MCPopulation::rank_, ConstantSizeMatrix< T, ALLOC >::resize(), OutputManagerClass::resume(), RecordNamedProperty< T >::size(), ParticleSet::spins, MCPopulation::trial_wf_, MCPopulation::walker_elec_particle_sets_, MCPopulation::walker_hamiltonians_, MCPopulation::walker_trial_wavefunctions_, and MCPopulation::walkers_.
Referenced by QMCDriverNew::makeLocalWalkers(), and qmcplusplus::TEST_CASE().
|
inline |
Definition at line 204 of file MCPopulation.h.
References MCPopulation::dead_walker_hamiltonians_.
|
inline |
Definition at line 201 of file MCPopulation.h.
References MCPopulation::dead_walker_trial_wavefunctions_.
|
inline |
Definition at line 196 of file MCPopulation.h.
References MCPopulation::dead_walkers_.
Referenced by QMCDriverNew::get_num_dead_walkers().
|
inline |
Definition at line 198 of file MCPopulation.h.
References MCPopulation::walker_elec_particle_sets_.
Referenced by VMCBatched::run().
|
inline |
Definition at line 176 of file MCPopulation.h.
References MCPopulation::elec_particle_set_.
Referenced by QMCDriverNew::initializeQMC(), SFNBranch::initParam(), QMCFixedSampleLinearOptimizeBatched::processOptXML(), QMCDriverNew::putWalkers(), DMCBatched::run(), DMCBatched::runDMCStep(), and VMCBatched::runVMCStep().
|
inline |
Definition at line 177 of file MCPopulation.h.
References MCPopulation::elec_particle_set_.
|
inline |
Definition at line 181 of file MCPopulation.h.
References MCPopulation::hamiltonian_.
Referenced by QMCDriverNew::initializeQMC(), QMCFixedSampleLinearOptimizeBatched::processOptXML(), and QMCDriverNew::QMCDriverNew().
|
inline |
Definition at line 178 of file MCPopulation.h.
References MCPopulation::trial_wf_.
Referenced by QMCDriverNew::initializeQMC(), and QMCFixedSampleLinearOptimizeBatched::processOptXML().
|
inline |
|
inline |
Definition at line 203 of file MCPopulation.h.
References MCPopulation::walker_hamiltonians_.
Referenced by DMCBatched::run().
|
inline |
|
inline |
Definition at line 168 of file MCPopulation.h.
References MCPopulation::num_global_walkers_.
Referenced by WalkerControl::branch(), SFNBranch::initParam(), and DMCBatched::process().
|
inline |
Definition at line 169 of file MCPopulation.h.
References MCPopulation::num_local_walkers_.
Referenced by WalkerControl::branch(), VMCBatched::enable_sample_collection(), qmcplusplus::operator<<(), and UnifiedDriverWalkerControlMPITest::reportWalkersPerRank().
|
inline |
The number of cases in which this and get_num_local_walkers is so few that I strongly suspect it is a design issue.
get_active_walkers is onlyh useful between the setting of num_local_walkers_ and creation of walkers. I would reason this is actually a time over which the MCPopulation object is invalid. Ideally MCPopulation not process any calls in this state, next best would be to only process calls to become valid.
Definition at line 166 of file MCPopulation.h.
References MCPopulation::num_ranks_.
Referenced by VMCBatched::enable_sample_collection().
|
inline |
Definition at line 225 of file MCPopulation.h.
References MCPopulation::ptcl_inv_mass_.
|
inline |
Definition at line 224 of file MCPopulation.h.
References MCPopulation::ptclgrp_inv_mass_.
Referenced by VMCBatched::advanceWalkers(), and DMCBatched::advanceWalkers().
|
inline |
Definition at line 223 of file MCPopulation.h.
References MCPopulation::ptclgrp_mass_.
|
inline |
|
inline |
Definition at line 171 of file MCPopulation.h.
References MCPopulation::target_population_.
|
inline |
|
inline |
Definition at line 200 of file MCPopulation.h.
References MCPopulation::walker_trial_wavefunctions_.
std::vector< WalkerElementsRef > get_walker_elements | ( | ) |
As long as walker WalkerElements is used we need this for unit tests.
As operator[] don't use it to ignore the concurrency design.
Definition at line 121 of file MCPopulation.cpp.
References MCPopulation::walker_elec_particle_sets_, MCPopulation::walker_trial_wavefunctions_, and MCPopulation::walkers_.
|
inline |
Definition at line 194 of file MCPopulation.h.
References MCPopulation::walkers_.
Referenced by WalkerControl::branch(), QMCDriverNew::get_num_living_walkers(), WalkerControl::killDeadWalkersOnRank(), and QMCDriverNew::makeLocalWalkers().
|
inline |
WalkerElementsRef getWalkerElementsRef | ( | const size_t | walker_index | ) |
Non threadsafe access to walkers and their elements.
Prefer to distribute the walker elements and access through a crowd to support the concurrency design.
You should not use this unless absolutely necessary. That doesn't include that you would rather just use omp parallel and ignore concurrency.
Definition at line 116 of file MCPopulation.cpp.
References MCPopulation::walker_elec_particle_sets_, MCPopulation::walker_trial_wavefunctions_, and MCPopulation::walkers_.
void killLastWalker | ( | ) |
Kill last walker (just barely)
By kill we mean put it and all its elements in a "dead" list.
Definition at line 188 of file MCPopulation.cpp.
References MCPopulation::dead_walker_elec_particle_sets_, MCPopulation::dead_walker_hamiltonians_, MCPopulation::dead_walker_trial_wavefunctions_, MCPopulation::dead_walkers_, MCPopulation::num_local_walkers_, MCPopulation::walker_elec_particle_sets_, MCPopulation::walker_hamiltonians_, MCPopulation::walker_trial_wavefunctions_, and MCPopulation::walkers_.
Referenced by MCPopulation::createWalkers(), and QMCDriverNew::makeLocalWalkers().
void killWalker | ( | MCPWalker & | walker | ) |
Kill a walker (just barely)
By kill we mean put it and all its elements in a "dead" list.
Definition at line 205 of file MCPopulation.cpp.
References MCPopulation::dead_walker_elec_particle_sets_, MCPopulation::dead_walker_hamiltonians_, MCPopulation::dead_walker_trial_wavefunctions_, MCPopulation::dead_walkers_, MCPopulation::num_local_walkers_, qmcplusplus::walker, MCPopulation::walker_elec_particle_sets_, MCPopulation::walker_hamiltonians_, MCPopulation::walker_trial_wavefunctions_, and MCPopulation::walkers_.
Referenced by WalkerControl::killDeadWalkersOnRank().
void measureGlobalEnergyVariance | ( | Communicate & | comm, |
FullPrecRealType & | ener, | ||
FullPrecRealType & | variance | ||
) | const |
Definition at line 245 of file MCPopulation.cpp.
References Communicate::allreduce(), qmcplusplus::comm, qmcplusplus::Units::charge::e, MCPopulation::walker_elec_particle_sets_, MCPopulation::walker_hamiltonians_, and MCPopulation::walkers_.
Referenced by DMCBatched::run().
|
delete |
|
inline |
distributes walkers and their "cloned" elements to the elements of a vector of unique_ptr to "walker_consumers".
a valid "walker_consumer" has a member function of void addWalker(MCPWalker& walker, ParticleSet& elecs, TrialWaveFunction& twf, QMCHamiltonian& hamiltonian);
Definition at line 131 of file MCPopulation.h.
References fairDivide(), MCPopulation::walker_elec_particle_sets_, MCPopulation::walker_hamiltonians_, MCPopulation::walker_trial_wavefunctions_, and MCPopulation::walkers_.
Referenced by QMCDriverNew::initializeQMC(), and DMCBatched::run().
void saveWalkerConfigurations | ( | WalkerConfigurations & | walker_configs | ) |
save walker configurations to walker_configs_ref_
Definition at line 291 of file MCPopulation.cpp.
References MCPopulation::elec_particle_set_, ParticleSet::getTotalNum(), WalkerConfigurations::resize(), MCPopulation::walker_elec_particle_sets_, and MCPopulation::walkers_.
Referenced by QMCDriverNew::finalize(), and QMCDriverNew::recordBlock().
|
inline |
Definition at line 189 of file MCPopulation.h.
References MCPopulation::ensemble_property_.
Referenced by WalkerControl::branch().
|
inline |
Definition at line 183 of file MCPopulation.h.
References MCPopulation::num_global_walkers_.
Referenced by WalkerControl::branch(), and QMCDriverNew::initializeQMC().
|
inline |
Definition at line 184 of file MCPopulation.h.
References MCPopulation::num_local_walkers_.
|
inline |
Definition at line 186 of file MCPopulation.h.
References MCPopulation::target_population_.
|
inline |
WalkerElementsRef spawnWalker | ( | ) |
State Requirement:
creates a walker and returns a reference
Walkers are reused It would be better if this could be done just by reusing memory. Not thread safe.
Definition at line 138 of file MCPopulation.cpp.
References qmcplusplus::app_warning(), MCPopulation::dead_walker_elec_particle_sets_, MCPopulation::dead_walker_hamiltonians_, MCPopulation::dead_walker_trial_wavefunctions_, MCPopulation::dead_walkers_, MCPopulation::elec_particle_set_, MCPopulation::hamiltonian_, QMCHamiltonian::makeClone(), TrialWaveFunction::makeClone(), MCPopulation::num_local_walkers_, MCPopulation::num_ranks_, outputManager, OutputManagerClass::pause(), MCPopulation::rank_, OutputManagerClass::resume(), MCPopulation::trial_wf_, MCPopulation::walker_elec_particle_sets_, MCPopulation::walker_hamiltonians_, MCPopulation::walker_trial_wavefunctions_, and MCPopulation::walkers_.
Referenced by WalkerControl::branch(), and QMCDriverNew::makeLocalWalkers().
void syncWalkersPerRank | ( | Communicate * | comm | ) |
Definition at line 235 of file MCPopulation.cpp.
References Communicate::allreduce(), qmcplusplus::comm, MCPopulation::num_global_walkers_, MCPopulation::num_local_walkers_, Communicate::rank(), and Communicate::size().
Referenced by WalkerControl::branch().
|
private |
Definition at line 82 of file MCPopulation.h.
Referenced by MCPopulation::checkIntegrity(), MCPopulation::killLastWalker(), MCPopulation::killWalker(), and MCPopulation::spawnWalker().
|
private |
Definition at line 84 of file MCPopulation.h.
Referenced by MCPopulation::checkIntegrity(), MCPopulation::get_dead_hamiltonians(), MCPopulation::killLastWalker(), MCPopulation::killWalker(), and MCPopulation::spawnWalker().
|
private |
Definition at line 83 of file MCPopulation.h.
Referenced by MCPopulation::checkIntegrity(), MCPopulation::get_dead_twfs(), MCPopulation::killLastWalker(), MCPopulation::killWalker(), and MCPopulation::spawnWalker().
|
private |
Definition at line 62 of file MCPopulation.h.
Referenced by MCPopulation::checkIntegrity(), MCPopulation::get_dead_walkers(), MCPopulation::killLastWalker(), MCPopulation::killWalker(), and MCPopulation::spawnWalker().
|
private |
Definition at line 73 of file MCPopulation.h.
Referenced by MCPopulation::createWalkers(), MCPopulation::get_golden_electrons(), MCPopulation::saveWalkerConfigurations(), and MCPopulation::spawnWalker().
|
private |
Definition at line 51 of file MCPopulation.h.
Referenced by MCPopulation::set_ensemble_property().
|
private |
Definition at line 74 of file MCPopulation.h.
Referenced by MCPopulation::createWalkers(), MCPopulation::get_golden_hamiltonian(), and MCPopulation::spawnWalker().
|
private |
Definition at line 55 of file MCPopulation.h.
Referenced by MCPopulation::get_max_samples().
|
private |
Definition at line 53 of file MCPopulation.h.
Referenced by MCPopulation::get_num_global_walkers(), MCPopulation::set_num_global_walkers(), and MCPopulation::syncWalkersPerRank().
|
private |
Definition at line 54 of file MCPopulation.h.
Referenced by MCPopulation::checkIntegrity(), MCPopulation::createWalkers(), MCPopulation::get_num_local_walkers(), MCPopulation::killLastWalker(), MCPopulation::killWalker(), MCPopulation::set_num_local_walkers(), MCPopulation::spawnWalker(), and MCPopulation::syncWalkersPerRank().
|
private |
Definition at line 88 of file MCPopulation.h.
Referenced by MCPopulation::createWalkers(), MCPopulation::get_num_ranks(), and MCPopulation::spawnWalker().
|
private |
1/Mass per particle
Definition at line 67 of file MCPopulation.h.
Referenced by MCPopulation::get_ptcl_inv_mass(), and MCPopulation::MCPopulation().
|
private |
1/Mass per species
Definition at line 65 of file MCPopulation.h.
Referenced by MCPopulation::get_ptclgrp_inv_mass(), and MCPopulation::MCPopulation().
|
private |
Definition at line 63 of file MCPopulation.h.
Referenced by MCPopulation::get_ptclgrp_mass(), and MCPopulation::MCPopulation().
|
private |
Definition at line 89 of file MCPopulation.h.
Referenced by MCPopulation::createWalkers(), MCPopulation::get_rank(), and MCPopulation::spawnWalker().
|
private |
Definition at line 56 of file MCPopulation.h.
Referenced by MCPopulation::get_target_population(), and MCPopulation::set_target().
|
private |
Definition at line 57 of file MCPopulation.h.
Referenced by MCPopulation::get_target_samples(), and MCPopulation::set_target_samples().
|
private |
Definition at line 72 of file MCPopulation.h.
Referenced by MCPopulation::createWalkers(), MCPopulation::get_golden_twf(), and MCPopulation::spawnWalker().
|
private |
Definition at line 76 of file MCPopulation.h.
Referenced by MCPopulation::checkIntegrity(), MCPopulation::createWalkers(), MCPopulation::get_elec_particle_sets(), MCPopulation::get_walker_elements(), MCPopulation::getWalkerElementsRef(), MCPopulation::killLastWalker(), MCPopulation::killWalker(), MCPopulation::measureGlobalEnergyVariance(), MCPopulation::redistributeWalkers(), MCPopulation::saveWalkerConfigurations(), and MCPopulation::spawnWalker().
|
private |
Definition at line 78 of file MCPopulation.h.
Referenced by MCPopulation::checkIntegrity(), MCPopulation::createWalkers(), MCPopulation::get_hamiltonians(), MCPopulation::killLastWalker(), MCPopulation::killWalker(), MCPopulation::measureGlobalEnergyVariance(), MCPopulation::redistributeWalkers(), and MCPopulation::spawnWalker().
|
private |
Definition at line 77 of file MCPopulation.h.
Referenced by MCPopulation::checkIntegrity(), MCPopulation::createWalkers(), MCPopulation::get_twfs(), MCPopulation::get_walker_elements(), MCPopulation::getWalkerElementsRef(), MCPopulation::killLastWalker(), MCPopulation::killWalker(), MCPopulation::redistributeWalkers(), and MCPopulation::spawnWalker().
|
private |
Definition at line 61 of file MCPopulation.h.
Referenced by MCPopulation::checkIntegrity(), MCPopulation::createWalkers(), MCPopulation::get_walker_elements(), MCPopulation::get_walkers(), MCPopulation::getWalkerElementsRef(), MCPopulation::killLastWalker(), MCPopulation::killWalker(), MCPopulation::measureGlobalEnergyVariance(), MCPopulation::redistributeWalkers(), MCPopulation::saveWalkerConfigurations(), and MCPopulation::spawnWalker().