28 #if !defined(REMOVE_TRACEMANAGER) 31 using TraceManager = int;
75 #if !defined(REMOVE_TRACEMANAGER) 82 for (
int block = 0; block <
nBlocks; ++block)
96 for (
int step = 0; step <
nSteps; ++step)
99 wClones[ip]->resetCollectables();
100 Movers[ip]->advanceWalkers(wit, wit_end,
false);
101 if (has_collectables)
102 wClones[ip]->Collectables *= cnorm;
103 Movers[ip]->accumulate(wit, wit_end);
107 wClones[ip]->saveEnsemble(wit, wit_end);
113 Movers[ip]->stopBlock(
false);
120 bool stop_requested =
false;
123 stop_requested = runtimeControl.checkStop(rmc_loop);
129 app_log() << runtimeControl.generateStopMessage(
"RMC", block);
154 app_log() <<
"Projection time: " <<
beta <<
" Ha^-1" << std::endl;
163 app_log() <<
"Previous RMC reptiles detected...\n";
165 app_log() <<
" Using current reptiles\n";
171 app_log() <<
" New Tau/Beta: " <<
Tau <<
"/" <<
beta << std::endl;
172 app_log() <<
" Linear interpolation to get new reptile.\n";
173 std::vector<ReptileConfig_t> repSamps(0);
180 repSamps.push_back(repSamps[copyid]);
191 app_log() <<
"Using walkers from previous non-RMC run.\n";
192 std::vector<ParticlePos> wSamps(0);
195 wSamps.push_back((**wit).R);
198 wSamps.push_back(wSamps[copyid]);
220 #pragma omp parallel for 223 std::ostringstream os;
227 #if !defined(REMOVE_TRACEMANAGER) 230 hClones[ip]->setRandomGenerator(
Rng[ip].
get());
233 os <<
" PbyP moves with drift, using RMCUpdatePbyPWithDriftFast" << std::endl;
239 os <<
" walker moves with drift, using RMCUpdateAllWithDriftFast" << std::endl;
244 app_log() << os.str() << std::endl;
247 #if !defined(REMOVE_TRACEMANAGER) 250 #pragma omp parallel for 258 #pragma omp parallel for 292 #pragma omp parallel for 295 for (
int prestep = 0; prestep <
nWarmupSteps; ++prestep)
316 std::vector<int> repWalkerSlice;
317 int nwtot = nbeads_in * nReptiles_in;
322 for (
int i = 0; i < nReptiles_in; i++)
325 std::make_unique<Reptile>(
W,
W.
begin() + repWalkerSlice[i],
W.
begin() + repWalkerSlice[i + 1]));
332 if (reptile_samps.empty())
334 APP_ABORT(
"RMC::resetReptiles(std::vector< ReptileConfig_t > reptile_samps): No samples!\n");
338 IndexType nReptiles_in = reptile_samps.size();
339 IndexType nBeads_in = reptile_samps[0].size();
344 W.
ReptileList[i]->setReptileSlicePositions(reptile_samps[i]);
351 if (walker_samps.empty())
353 APP_ABORT(
"RMC::resetReptiles(std::vector< ParticlePos > walker_samps): No samples!\n");
357 IndexType nReptiles_in = walker_samps.size();
362 W.
ReptileList[i]->setReptileSlicePositions(walker_samps[i]);
size_type size() const
return the size of the data
int MaxCPUSecs
maximum cpu in secs
A set of walkers that are to be advanced by Metropolis Monte Carlo.
static std::vector< TrialWaveFunction * > psiClones
ReptileList_t ReptileList
a collection of reptiles contained in MCWalkerConfiguration.
std::vector< int > wPerRank
Walkers per MPI rank.
helper functions for EinsplineSetBuilder
int rank() const
return the rank
QTBase::RealType RealType
size_t getActiveWalkers() const
return the number of active walkers
void recordBlock(int block) override
record the state of the block
std::string RootName
root of all the output files
static std::vector< MCWalkerConfiguration * > wClones
xmlNodePtr qmcNode
pointer to qmc node in xml file
int addProperty(const std::string &pname)
RunTimeManager< ChronoClock > run_time_manager
Collection of Local Energy Operators.
IndexType CurrentStep
current step
std::vector< QMCUpdateBase * > Movers
update engines
abstract base class for QMC engines
std::unique_ptr< TraceManager > Traces
Traces manager.
void stop()
stop a qmc run
bool put(std::istream &is) override
read from std::istream
void FairDivideLow(int ntot, int npart, IV &adist)
partition ntot elements among npart
ParameterSet m_param
store any parameter that has to be read from a file
IndexType nSubSteps
number of steps between a step: VMCs do not evaluate energies
Wrapping information on parallelism.
omp_int_t omp_get_thread_num()
IndexType nSteps
maximum number of steps
bool finalize(int block, bool dumpwalkers=true)
finalize a qmc section
const std::string & getName() const
WalkerList_t::iterator iterator
FIX: a type alias of iterator for an object should not be for just one of many objects it holds...
A collection of functions for dividing fairly.
std::bitset< QMC_MODE_MAX > qmc_driver_mode
bits to classify QMCDriver
Communicate * myComm
pointer to Communicate
int myPeriod4WalkerDump
period for walker dump
std::unique_ptr< BranchEngineType > branchEngine
branch engine
std::vector< EstimatorManagerBase * > estimatorClones
estimator managers
const IndexType NumThreads
number of threads
QMCHamiltonian & H
Hamiltonian.
DriftModifierBase * DriftModifier
drift modifer
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
void makeClones(MCWalkerConfiguration &w, TrialWaveFunction &psi, QMCHamiltonian &ham)
void resetReptiles(int nReptiles, int nbeads, RealType tau)
MCWalkerConfiguration & W
walker ensemble
static UPtrVector< RandomBase< FullPrecRealType > > Children
Implements the RMC algorithm using all electron moves
OHMMS_INDEXTYPE IndexType
define other types
Implements the RMC algorithm using all electron moves
Buffer_t Collectables
observables in addition to those registered in Properties/PropertyList
Class to manage a set of ScalarEstimators.
static std::vector< QMCHamiltonian * > hClones
void add(PDT &aparam, const std::string &aname_in, std::vector< PDT > candidate_values={}, TagStatus status=TagStatus::OPTIONAL)
add a new parameter corresponding to an xmlNode <parameter>
Class for determining elapsed run time enabling simulations to adjust to time limits.
Class to represent a many-body trial wave function.
int resizeReptile
rescale for time step studies. some int>2 and new beads are inserted in between the old ones...
RMC(const ProjectData &project_data, MCWalkerConfiguration &w, TrialWaveFunction &psi, QMCHamiltonian &h, Communicate *comm)
Constructor.
Declaraton of ParticleAttrib<T>
EstimatorManagerBase * Estimators
Observables manager.
void stopBlock(RealType accept, bool collectall=true)
stop a block
TrialWaveFunction & Psi
trial function
IndexType nBlocks
maximum number of blocks
std::vector< int > Action
bool put(xmlNodePtr cur) override
int Period4WalkerDump
period of recording walker configurations
std::vector< TraceManager * > traceClones
trace managers
int Period4CheckProperties
period of dumping walker positions and IDs for Forward Walking
void addWalkers(int nwalkers)
Add walkers to the end of the ensemble of walkers.
RealType beta
projection time of reptile
IndexType nWarmupSteps
number of warmup steps
UPtrVector< RandomBase< FullPrecRealType > > Rng
Random number generators.
void start(int blocks, bool record=true)
start a run
iterator end()
return the last iterator, [begin(), end())
void resetVars()
check the run-time environments
std::vector< int > TransProb
int beads
number of beads on the reptile, beta/tau
std::string rescaleDrift
option to enable/disable drift equation for RMC
iterator begin()
return the first iterator