![]() |
QMCPACK
|
A set of light weight walkers that are carried between driver sections and restart. More...
Public Types | |
using | Walker_t = Walker< QMCTraits, PtclOnLatticeTraits > |
walker type More... | |
using | FullPrecRealType = QMCTraits::FullPrecRealType |
using | walker_list__t = std::vector< std::unique_ptr< Walker_t > > |
container type of Walkers More... | |
using | iterator = walker_list__t::iterator |
FIX: a type alias of iterator for an object should not be for just one of many objects it holds. More... | |
using | const_iterator = walker_list__t::const_iterator |
const_iterator of Walker container More... | |
Public Member Functions | |
WalkerConfigurations () | |
~WalkerConfigurations () | |
default destructor More... | |
WalkerConfigurations (const WalkerConfigurations &)=delete | |
WalkerConfigurations & | operator= (const WalkerConfigurations &)=delete |
WalkerConfigurations (WalkerConfigurations &&)=default | |
WalkerConfigurations & | operator= (WalkerConfigurations &&)=default |
void | createWalkers (int numWalkers, size_t numPtcls) |
create numWalkers Walkers More... | |
void | createWalkers (iterator first, iterator last) |
create walkers More... | |
void | copyWalkers (iterator first, iterator last, iterator start) |
copy walkers More... | |
iterator | destroyWalkers (iterator first, iterator last) |
destroy Walkers from itstart to itend More... | |
void | destroyWalkers (int nw) |
destroy Walkers More... | |
void | resize (int numWalkers, size_t numPtcls) |
clean up the walker list and make a new list More... | |
size_t | getActiveWalkers () const |
return the number of active walkers More... | |
size_t | getGlobalNumWalkers () const |
return the total number of active walkers among a MPI group More... | |
void | setWalkerOffsets (const std::vector< int > &o) |
return the total number of active walkers among a MPI group More... | |
const std::vector< int > & | getWalkerOffsets () const |
iterator | begin () |
return the first iterator More... | |
iterator | end () |
return the last iterator, [begin(), end()) More... | |
const_iterator | begin () const |
return the first const_iterator More... | |
const_iterator | end () const |
return the last const_iterator [begin(), end()) More... | |
void | clear () |
clear the walker_list_ without destroying them More... | |
template<class INPUT_ITER > | |
void | insert (iterator it, INPUT_ITER first, INPUT_ITER last) |
insert elements More... | |
void | push_back (std::unique_ptr< Walker_t > awalker) |
add Walker_t* at the end More... | |
void | pop_back () |
delete the last Walker_t* More... | |
Walker_t * | operator[] (int i) |
const Walker_t * | operator[] (int i) const |
void | reset () |
reset the Walkers More... | |
void | putConfigurations (Walker_t::RealType *target, QMCTraits::FullPrecRealType *weights) const |
save the particle positions of all the walkers into target More... | |
Public Attributes | |
MCDataType< FullPrecRealType > | EnsembleProperty |
Protected Attributes | |
walker_list__t | walker_list_ |
a collection of walkers More... | |
Private Attributes | |
std::vector< int > | walker_offsets_ |
starting index of the walkers in a processor group More... | |
A set of light weight walkers that are carried between driver sections and restart.
Definition at line 56 of file WalkerConfigurations.h.
using const_iterator = walker_list__t::const_iterator |
const_iterator of Walker container
Definition at line 67 of file WalkerConfigurations.h.
Definition at line 61 of file WalkerConfigurations.h.
using iterator = walker_list__t::iterator |
FIX: a type alias of iterator for an object should not be for just one of many objects it holds.
Definition at line 65 of file WalkerConfigurations.h.
using walker_list__t = std::vector<std::unique_ptr<Walker_t> > |
container type of Walkers
Definition at line 63 of file WalkerConfigurations.h.
using Walker_t = Walker<QMCTraits, PtclOnLatticeTraits> |
walker type
Definition at line 60 of file WalkerConfigurations.h.
|
default |
~WalkerConfigurations | ( | ) |
default destructor
Definition at line 29 of file WalkerConfigurations.cpp.
References WalkerConfigurations::destroyWalkers(), and WalkerConfigurations::walker_list_.
|
delete |
|
default |
|
inline |
return the first iterator
Definition at line 121 of file WalkerConfigurations.h.
References WalkerConfigurations::walker_list_.
Referenced by EstimatorManagerBase::accumulate(), QMCDriver::addWalkers(), WalkerReconfigurationMPI::branch(), WalkerControlBase::copyWalkers(), WaveFunctionTester::printEloc(), RMC::resetReptiles(), VMC::resetRun(), CSVMC::resetRun(), RMC::resetRun(), DMC::resetUpdateEngines(), VMC::run(), RMC::run(), CSVMC::run(), WaveFunctionTester::runBasicTest(), WaveFunctionTester::runCloneTest(), WaveFunctionTester::runDerivCloneTest(), WaveFunctionTester::runDerivNLPPTest(), WaveFunctionTester::runDerivTest(), WaveFunctionTester::runGradSourceTest(), WaveFunctionTester::runNodePlot(), WaveFunctionTester::runRatioTest(), WaveFunctionTester::runRatioTest2(), WaveFunctionTester::runRatioV(), WaveFunctionTester::runZeroVarianceTest(), WalkerReconfigurationMPI::swapWalkers(), and qmcplusplus::TEST_CASE().
|
inline |
return the first const_iterator
Definition at line 126 of file WalkerConfigurations.h.
References WalkerConfigurations::walker_list_.
|
inline |
clear the walker_list_ without destroying them
Provide std::vector::clear interface
Definition at line 136 of file WalkerConfigurations.h.
References WalkerConfigurations::walker_list_.
copy walkers
first | input walker iterator |
last | input walker iterator |
start | first target iterator |
No memory allocation is allowed.
Definition at line 115 of file WalkerConfigurations.cpp.
void createWalkers | ( | int | numWalkers, |
size_t | numPtcls | ||
) |
create numWalkers Walkers
Append Walkers to walker_list_.
Definition at line 32 of file WalkerConfigurations.cpp.
References qmcplusplus::n, and WalkerConfigurations::walker_list_.
Referenced by MCWalkerConfiguration::createWalkers(), HDFWalkerInput_0_4::read_hdf5(), HDFWalkerInput_0_4::read_hdf5_scatter(), HDFWalkerInput_0_4::read_phdf5(), WalkerConfigurations::resize(), and qmcplusplus::TEST_CASE().
create walkers
first | walker iterator |
last | walker iterator |
Definition at line 93 of file WalkerConfigurations.cpp.
References WalkerConfigurations::destroyWalkers(), and WalkerConfigurations::walker_list_.
WalkerConfigurations::iterator destroyWalkers | ( | iterator | first, |
iterator | last | ||
) |
destroy Walkers from itstart to itend
returns the next valid iterator
first | starting iterator of the walkers |
last | ending iterator of the walkers |
Definition at line 88 of file WalkerConfigurations.cpp.
References WalkerConfigurations::walker_list_.
Referenced by QMCDriver::addWalkers(), WalkerConfigurations::createWalkers(), QMCFixedSampleLinearOptimize::finish(), and WalkerConfigurations::~WalkerConfigurations().
void destroyWalkers | ( | int | nw | ) |
destroy Walkers
nw | number of walkers to be destroyed |
Definition at line 103 of file WalkerConfigurations.cpp.
References qmcplusplus::app_warning(), and WalkerConfigurations::walker_list_.
|
inline |
return the last iterator, [begin(), end())
Definition at line 123 of file WalkerConfigurations.h.
References WalkerConfigurations::walker_list_.
Referenced by EstimatorManagerBase::accumulate(), QMCDriver::addWalkers(), WalkerReconfigurationMPI::branch(), RMC::resetRun(), WaveFunctionTester::runBasicTest(), WaveFunctionTester::runRatioTest(), WaveFunctionTester::runRatioTest2(), WaveFunctionTester::runRatioV(), WalkerReconfigurationMPI::swapWalkers(), and qmcplusplus::TEST_CASE().
|
inline |
return the last const_iterator [begin(), end())
Definition at line 129 of file WalkerConfigurations.h.
References WalkerConfigurations::walker_list_.
|
inline |
return the number of active walkers
Definition at line 112 of file WalkerConfigurations.h.
References WalkerConfigurations::walker_list_.
Referenced by EstimatorManagerBase::accumulate(), QMCDriver::addWalkers(), WalkerControlBase::copyWalkers(), MCWalkerConfiguration::createWalkers(), MCPopulation::createWalkers(), MCWalkerConfiguration::dumpEnsemble(), QMCDriver::finalize(), QMCFixedSampleLinearOptimize::finish(), WalkerReconfiguration::getIndexPermutation(), VMCBatched::process(), DMCBatched::process(), QMCFixedSampleLinearOptimize::processOptXML(), QMCFixedSampleLinearOptimizeBatched::processOptXML(), VMC::put(), CSVMC::put(), QMCDriver::putQMCInfo(), QMCDriver::putWalkers(), QMCDriverNew::putWalkers(), QMCDriver::QMCDriver(), HDFWalkerInput_0_4::read_hdf5(), HDFWalkerInput_0_4::read_hdf5_scatter(), HDFWalkerInput_0_4::read_phdf5(), RMC::resetReptiles(), VMC::resetRun(), CSVMC::resetRun(), DMC::resetUpdateEngines(), MCWalkerConfiguration::resize(), DMC::run(), QMCDriver::setWalkerOffsets(), QMCDriverNew::setWalkerOffsets(), WalkerReconfigurationMPI::swapWalkers(), qmcplusplus::TEST_CASE(), and HDFWalkerOutput::write_configuration().
|
inline |
return the total number of active walkers among a MPI group
Definition at line 114 of file WalkerConfigurations.h.
References WalkerConfigurations::walker_offsets_.
Referenced by EstimatorManagerBase::accumulate(), QMCDriverNew::finalize(), and QMCDriver::process().
|
inline |
Definition at line 118 of file WalkerConfigurations.h.
References WalkerConfigurations::walker_offsets_.
Referenced by MCWalkerConfiguration::MCWalkerConfiguration(), and HDFWalkerOutput::write_configuration().
|
inline |
insert elements
it | locator where the inserting begins |
first | starting iterator |
last | ending iterator |
Provide std::vector::insert interface
Definition at line 146 of file WalkerConfigurations.h.
References WalkerConfigurations::walker_list_.
Referenced by WalkerControlBase::copyWalkers().
|
delete |
|
default |
|
inline |
Definition at line 164 of file WalkerConfigurations.h.
References WalkerConfigurations::walker_list_.
|
inline |
Definition at line 166 of file WalkerConfigurations.h.
References WalkerConfigurations::walker_list_.
|
inline |
delete the last Walker_t*
Provide std::vector::pop_back interface
Definition at line 162 of file WalkerConfigurations.h.
References WalkerConfigurations::walker_list_.
Referenced by MCWalkerConfiguration::loadEnsemble(), and WalkerReconfigurationMPI::swapWalkers().
|
inline |
add Walker_t* at the end
awalker | pointer to a walker |
Provide std::vector::push_back interface
Definition at line 156 of file WalkerConfigurations.h.
References WalkerConfigurations::walker_list_.
Referenced by MCWalkerConfiguration::dumpEnsemble().
void putConfigurations | ( | Walker_t::RealType * | target, |
QMCTraits::FullPrecRealType * | weights | ||
) | const |
save the particle positions of all the walkers into target
Definition at line 138 of file WalkerConfigurations.cpp.
References copy(), qmcplusplus::get_first_address(), qmcplusplus::get_last_address(), qmcplusplus::walker, and WalkerConfigurations::walker_list_.
Referenced by HDFWalkerOutput::write_configuration().
void reset | ( | ) |
reset the Walkers
Make Metropolis move to the walkers and save in a temporary array.
it | the iterator of the first walker to work on |
tauinv | inverse of the time step |
R + D + X
Definition at line 129 of file WalkerConfigurations.cpp.
References qmcplusplus::walker, and WalkerConfigurations::walker_list_.
void resize | ( | int | numWalkers, |
size_t | numPtcls | ||
) |
clean up the walker list and make a new list
Definition at line 72 of file WalkerConfigurations.cpp.
References WalkerConfigurations::createWalkers(), and WalkerConfigurations::walker_list_.
Referenced by MCWalkerConfiguration::resize(), MCPopulation::saveWalkerConfigurations(), and qmcplusplus::TEST_CASE().
|
inline |
return the total number of active walkers among a MPI group
Definition at line 117 of file WalkerConfigurations.h.
References WalkerConfigurations::walker_offsets_.
Referenced by MCWalkerConfiguration::dumpEnsemble(), MCWalkerConfiguration::MCWalkerConfiguration(), QMCDriver::putWalkers(), QMCDriver::setWalkerOffsets(), QMCDriverNew::setWalkerOffsets(), and qmcplusplus::TEST_CASE().
MCDataType<FullPrecRealType> EnsembleProperty |
Definition at line 69 of file WalkerConfigurations.h.
Referenced by WalkerReconfiguration::branch(), WalkerReconfigurationMPI::branch(), WalkerControlMPI::branch(), WalkerControlBase::branch(), QMCDriver::setWalkerOffsets(), and WalkerReconfigurationMPI::swapWalkers().
|
protected |
a collection of walkers
Definition at line 177 of file WalkerConfigurations.h.
Referenced by WalkerConfigurations::begin(), WalkerConfigurations::clear(), WalkerConfigurations::createWalkers(), MCWalkerConfiguration::createWalkers(), WalkerConfigurations::destroyWalkers(), WalkerConfigurations::end(), WalkerConfigurations::getActiveWalkers(), WalkerConfigurations::insert(), MCWalkerConfiguration::loadEnsemble(), WalkerConfigurations::operator[](), WalkerConfigurations::pop_back(), WalkerConfigurations::push_back(), WalkerConfigurations::putConfigurations(), WalkerConfigurations::reset(), MCWalkerConfiguration::resetWalkerProperty(), MCWalkerConfiguration::resize(), WalkerConfigurations::resize(), MCWalkerConfiguration::resizeWalkerHistories(), MCWalkerConfiguration::saveEnsemble(), and WalkerConfigurations::~WalkerConfigurations().
|
private |
starting index of the walkers in a processor group
walker_offsets_[0]=0 and walker_offsets_[walker_offsets_.size()-1]=total number of walkers in a group walker_offsets_[processorid+1]-walker_offsets_[processorid] is equal to the number of walkers on a processor, i.e., W.getActiveWalkers(). walker_offsets_ is added to handle parallel I/O with hdf5
Definition at line 187 of file WalkerConfigurations.h.
Referenced by WalkerConfigurations::getGlobalNumWalkers(), WalkerConfigurations::getWalkerOffsets(), and WalkerConfigurations::setWalkerOffsets().