![]() |
QMCPACK
|
Crowd-level resource for walker log collection. More...
Public Member Functions | |
WalkerLogCollector (const WalkerLogState &state) | |
constructor. The state should be given by the manager. More... | |
void | startBlock () |
resize buffers to zero rows at beginning of each MC block More... | |
void | collect (const MCPWalker &walker, const ParticleSet &pset, const TrialWaveFunction &wfn, const QMCHamiltonian &ham, int step=-1) |
collect all data for one walker into the data buffers More... | |
void | checkBuffers () |
Check that all buffers have the same number of rows. More... | |
Public Attributes | |
std::vector< size_t > | steps |
MC step information for each walker throughout the MC block. More... | |
std::vector< WLog::Real > | energies |
LocalEnergy information for each walker throughout the MC block. More... | |
WalkerLogBuffer< WLog::Int > | walker_property_int_buffer |
buffer containing integer walker properties More... | |
WalkerLogBuffer< WLog::Real > | walker_property_real_buffer |
buffer containing real-valued walker properties More... | |
WalkerLogBuffer< WLog::Real > | walker_particle_real_buffer |
buffer containing per-particle walker data More... | |
std::unordered_set< std::string > | properties_include |
ParticleSet::PropertyList quantities to include. More... | |
std::vector< size_t > | property_indices |
indices in ParticleSet::PropertyList for included quantities More... | |
int | energy_index |
location of LocalEnergy in ParticleSet::PropertyList More... | |
Private Member Functions | |
void | init () |
shared variable setting in constructors More... | |
void | resetBuffers () |
resize buffers to zero rows More... | |
Private Attributes | |
Array< WLog::Real, 2 > | Rtmp |
tmp storage for walker positions More... | |
Array< WLog::Real, 1 > | Stmp |
tmp storage for walker spins More... | |
Array< WLog::PsiVal, 2 > | Gtmp |
tmp storage for walker wavefunction gradients More... | |
Array< WLog::PsiVal, 1 > | Ltmp |
tmp storage for walker wavefunciton laplacians More... | |
const WalkerLogState & | state_ |
state data set by WalkerLogManager More... | |
Crowd-level resource for walker log collection.
Contains data buffers for walker properties and walker particle data. Data buffers are resized to zero at the start of an MC block. Data for all walkers is collected into the buffers each MC step in an MC block. This class is not responsible for I/O.
Definition at line 49 of file WalkerLogCollector.h.
WalkerLogCollector | ( | const WalkerLogState & | state | ) |
constructor. The state should be given by the manager.
Definition at line 26 of file WalkerLogCollector.cpp.
References WalkerLogCollector::init().
void checkBuffers | ( | ) |
Check that all buffers have the same number of rows.
This ensures that the full data for a given walker can be reconstructed due to enforced data alignment in the buffers.
Definition at line 176 of file WalkerLogCollector.cpp.
References qmcplusplus::app_log(), WalkerLogCollector::energies, WalkerLogBuffer< T >::nrows(), WalkerLogCollector::state_, WalkerLogCollector::steps, WalkerLogState::verbose, WalkerLogCollector::walker_particle_real_buffer, WalkerLogCollector::walker_property_int_buffer, and WalkerLogCollector::walker_property_real_buffer.
Referenced by WalkerLogManager::writeBuffers().
void collect | ( | const MCPWalker & | walker, |
const ParticleSet & | pset, | ||
const TrialWaveFunction & | wfn, | ||
const QMCHamiltonian & | ham, | ||
int | step = -1 |
||
) |
collect all data for one walker into the data buffers
Definition at line 54 of file WalkerLogCollector.cpp.
References qmcplusplus::abs(), qmcplusplus::Units::pressure::bar, WalkerLogCollector::energies, WalkerLogCollector::energy_index, TrialWaveFunction::getLogPsi(), TrialWaveFunction::getPhase(), WalkerLogCollector::Gtmp, qmcplusplus::if(), qmcplusplus::imag(), WalkerLogState::logs_active, WalkerLogCollector::Ltmp, omptarget::min(), qmcplusplus::n, WalkerLogCollector::properties_include, WalkerLogCollector::property_indices, qmcplusplus::pset, Array< T, D, ALLOC >::resize(), WalkerLogCollector::Rtmp, WalkerLogCollector::state_, WalkerLogState::step_period, WalkerLogCollector::steps, WalkerLogCollector::Stmp, Array< T, D, ALLOC >::storage(), qmcplusplus::walker, WalkerLogCollector::walker_particle_real_buffer, WalkerLogCollector::walker_property_int_buffer, and WalkerLogCollector::walker_property_real_buffer.
Referenced by DMCUpdatePbyPWithRejectionFast::advanceWalker(), VMCUpdatePbyP::advanceWalker(), and qmcplusplus::TEST_CASE().
|
private |
shared variable setting in constructors
Definition at line 29 of file WalkerLogCollector.cpp.
References WalkerLogCollector::energies, WalkerLogCollector::energy_index, WalkerLogBuffer< T >::label, WalkerLogCollector::properties_include, WalkerLogCollector::steps, WalkerLogCollector::walker_particle_real_buffer, WalkerLogCollector::walker_property_int_buffer, and WalkerLogCollector::walker_property_real_buffer.
Referenced by WalkerLogCollector::WalkerLogCollector().
|
private |
resize buffers to zero rows
Definition at line 162 of file WalkerLogCollector.cpp.
References qmcplusplus::app_log(), WalkerLogCollector::energies, WalkerLogBuffer< T >::resetBuffer(), WalkerLogCollector::state_, WalkerLogCollector::steps, WalkerLogState::verbose, WalkerLogCollector::walker_particle_real_buffer, WalkerLogCollector::walker_property_int_buffer, and WalkerLogCollector::walker_property_real_buffer.
Referenced by WalkerLogCollector::startBlock().
void startBlock | ( | ) |
resize buffers to zero rows at beginning of each MC block
Definition at line 44 of file WalkerLogCollector.cpp.
References qmcplusplus::app_log(), WalkerLogState::logs_active, WalkerLogCollector::resetBuffers(), WalkerLogCollector::state_, and WalkerLogState::verbose.
Referenced by QMCUpdateBase::startBlock().
std::vector<WLog::Real> energies |
LocalEnergy information for each walker throughout the MC block.
Definition at line 55 of file WalkerLogCollector.h.
Referenced by WalkerLogCollector::checkBuffers(), WalkerLogCollector::collect(), WalkerLogCollector::init(), WalkerLogCollector::resetBuffers(), and WalkerLogManager::writeBuffers().
int energy_index |
location of LocalEnergy in ParticleSet::PropertyList
Definition at line 68 of file WalkerLogCollector.h.
Referenced by WalkerLogCollector::collect(), and WalkerLogCollector::init().
|
private |
tmp storage for walker wavefunction gradients
Definition at line 77 of file WalkerLogCollector.h.
Referenced by WalkerLogCollector::collect().
|
private |
tmp storage for walker wavefunciton laplacians
Definition at line 79 of file WalkerLogCollector.h.
Referenced by WalkerLogCollector::collect().
std::unordered_set<std::string> properties_include |
ParticleSet::PropertyList quantities to include.
Definition at line 64 of file WalkerLogCollector.h.
Referenced by WalkerLogCollector::collect(), and WalkerLogCollector::init().
std::vector<size_t> property_indices |
indices in ParticleSet::PropertyList for included quantities
Definition at line 66 of file WalkerLogCollector.h.
Referenced by WalkerLogCollector::collect().
|
private |
tmp storage for walker positions
Definition at line 73 of file WalkerLogCollector.h.
Referenced by WalkerLogCollector::collect().
|
private |
state data set by WalkerLogManager
Definition at line 81 of file WalkerLogCollector.h.
Referenced by WalkerLogCollector::checkBuffers(), WalkerLogCollector::collect(), WalkerLogCollector::resetBuffers(), and WalkerLogCollector::startBlock().
std::vector<size_t> steps |
MC step information for each walker throughout the MC block.
Definition at line 53 of file WalkerLogCollector.h.
Referenced by WalkerLogCollector::checkBuffers(), WalkerLogCollector::collect(), WalkerLogCollector::init(), WalkerLogCollector::resetBuffers(), and WalkerLogManager::writeBuffers().
|
private |
tmp storage for walker spins
Definition at line 75 of file WalkerLogCollector.h.
Referenced by WalkerLogCollector::collect().
WalkerLogBuffer<WLog::Real> walker_particle_real_buffer |
buffer containing per-particle walker data
Definition at line 61 of file WalkerLogCollector.h.
Referenced by WalkerLogCollector::checkBuffers(), WalkerLogManager::checkCollectors(), WalkerLogCollector::collect(), WalkerLogCollector::init(), WalkerLogCollector::resetBuffers(), qmcplusplus::TEST_CASE(), and WalkerLogManager::writeBuffersHDF().
WalkerLogBuffer<WLog::Int> walker_property_int_buffer |
buffer containing integer walker properties
Definition at line 57 of file WalkerLogCollector.h.
Referenced by WalkerLogCollector::checkBuffers(), WalkerLogManager::checkCollectors(), WalkerLogCollector::collect(), WalkerLogCollector::init(), WalkerLogCollector::resetBuffers(), qmcplusplus::TEST_CASE(), and WalkerLogManager::writeBuffersHDF().
WalkerLogBuffer<WLog::Real> walker_property_real_buffer |
buffer containing real-valued walker properties
Definition at line 59 of file WalkerLogCollector.h.
Referenced by WalkerLogCollector::checkBuffers(), WalkerLogManager::checkCollectors(), WalkerLogCollector::collect(), WalkerLogCollector::init(), WalkerLogCollector::resetBuffers(), qmcplusplus::TEST_CASE(), and WalkerLogManager::writeBuffersHDF().