QMCPACK
DMCDriverInput Class Reference

Input representation for DMC driver class runtime parameters. More...

+ Collaboration diagram for DMCDriverInput:

Public Types

using IndexType = QMCTraits::IndexType
 
using RealType = QMCTraits::RealType
 
using FullPrecisionRealType = QMCTraits::FullPrecRealType
 

Public Member Functions

 DMCDriverInput ()
 
 DMCDriverInput (int walkers_per_rank)
 
void readXML (xmlNodePtr xml_input)
 
bool get_reconfiguration () const
 
IndexType get_max_age () const
 
IndexType get_branch_interval () const
 
double get_feedback () const
 
DMCRefEnergyScheme get_refenergy_update_scheme () const
 
const std::string & get_non_local_move () const
 
double get_alpha () const
 
double get_gamma () const
 
RealType get_reserve () const
 

Private Attributes

IndexType branch_interval_ = 1
 

Do not write out blocks of gets for variables like this there is are code_generation tools in QMCPACK_ROOT/utils/code_tools More...
 
double feedback_ = 1.0
 feed back parameter for population control More...
 
DMCRefEnergyScheme refenergy_update_scheme_
 input std::string to determine reference energy update scheme More...
 
std::string KillWalker
 input std::string to determine kill walkers or not More...
 
std::string SwapWalkers
 input std::string to determine swap walkers among mpi processors More...
 
bool reconfiguration_ = true
 reconfiguration flag More...
 
std::string NonLocalMove
 input std::string to determine to use nonlocal move More...
 
IndexType max_age_ = 10
 input to control maximum age allowed for walkers. More...
 
RealType reserve_ = 1.0
 reserved walkers for population growth More...
 
double alpha_ = 0.0
 
double gamma_ = 0.0
 

Friends

std::ostream & operator<< (std::ostream &o_stream, const DMCDriverInput &vmci)
 

Detailed Description

Input representation for DMC driver class runtime parameters.

Definition at line 23 of file DMCDriverInput.h.

Member Typedef Documentation

◆ FullPrecisionRealType

◆ IndexType

Definition at line 26 of file DMCDriverInput.h.

◆ RealType

Definition at line 27 of file DMCDriverInput.h.

Constructor & Destructor Documentation

◆ DMCDriverInput() [1/2]

DMCDriverInput ( )
inline

Definition at line 29 of file DMCDriverInput.h.

29 {};

◆ DMCDriverInput() [2/2]

DMCDriverInput ( int  walkers_per_rank)

Definition at line 16 of file DMCDriverInput.cpp.

16 {}

Member Function Documentation

◆ get_alpha()

double get_alpha ( ) const
inline

Definition at line 39 of file DMCDriverInput.h.

References DMCDriverInput::alpha_.

Referenced by DMCBatched::setNonLocalMoveHandler().

39 { return alpha_; }

◆ get_branch_interval()

IndexType get_branch_interval ( ) const
inline

Definition at line 35 of file DMCDriverInput.h.

References DMCDriverInput::branch_interval_.

Referenced by DMCBatched::process().

35 { return branch_interval_; }
IndexType branch_interval_
Do not write out blocks of gets for variables like this there is are code_generation tools in QMCPA...

◆ get_feedback()

double get_feedback ( ) const
inline

Definition at line 36 of file DMCDriverInput.h.

References DMCDriverInput::feedback_.

Referenced by DMCBatched::process().

36 { return feedback_; }
double feedback_
feed back parameter for population control

◆ get_gamma()

double get_gamma ( ) const
inline

Definition at line 40 of file DMCDriverInput.h.

References DMCDriverInput::gamma_.

Referenced by DMCBatched::setNonLocalMoveHandler().

40 { return gamma_; }

◆ get_max_age()

IndexType get_max_age ( ) const
inline

Definition at line 34 of file DMCDriverInput.h.

References DMCDriverInput::max_age_.

Referenced by DMCBatched::process().

34 { return max_age_; }
IndexType max_age_
input to control maximum age allowed for walkers.

◆ get_non_local_move()

const std::string& get_non_local_move ( ) const
inline

Definition at line 38 of file DMCDriverInput.h.

References DMCDriverInput::NonLocalMove.

Referenced by DMCBatched::setNonLocalMoveHandler().

38 { return NonLocalMove; }
std::string NonLocalMove
input std::string to determine to use nonlocal move

◆ get_reconfiguration()

bool get_reconfiguration ( ) const
inline

Definition at line 33 of file DMCDriverInput.h.

References DMCDriverInput::reconfiguration_.

Referenced by DMCBatched::process(), and DMCBatched::run().

33 { return reconfiguration_; }
bool reconfiguration_
reconfiguration flag

◆ get_refenergy_update_scheme()

DMCRefEnergyScheme get_refenergy_update_scheme ( ) const
inline

Definition at line 37 of file DMCDriverInput.h.

References DMCDriverInput::refenergy_update_scheme_.

Referenced by DMCBatched::process().

37 { return refenergy_update_scheme_; }
DMCRefEnergyScheme refenergy_update_scheme_
input std::string to determine reference energy update scheme

◆ get_reserve()

RealType get_reserve ( ) const
inline

Definition at line 41 of file DMCDriverInput.h.

References DMCDriverInput::reserve_.

Referenced by DMCBatched::process().

41 { return reserve_; }
RealType reserve_
reserved walkers for population growth

◆ readXML()

void readXML ( xmlNodePtr  xml_input)

Definition at line 18 of file DMCDriverInput.cpp.

References ParameterSet::add(), DMCDriverInput::alpha_, qmcplusplus::app_summary(), DMCDriverInput::branch_interval_, DMCDriverInput::feedback_, DMCDriverInput::gamma_, qmcplusplus::LIMITED_HISTORY, DMCDriverInput::max_age_, qmcplusplus::node, DMCDriverInput::NonLocalMove, ParameterSet::put(), DMCDriverInput::reconfiguration_, DMCDriverInput::refenergy_update_scheme_, DMCDriverInput::reserve_, and qmcplusplus::UNLIMITED_HISTORY.

Referenced by DMCFactoryNew::create(), and SetupDMCTest::operator()().

19 {
20  ParameterSet parameter_set_;
21  std::string reconfig_str;
22  std::string refE_update_scheme_str;
23  parameter_set_.add(reconfig_str, "reconfiguration", {"no", "yes", "runwhileincorrect"});
24  parameter_set_.add(NonLocalMove, "nonlocalmove", {"no", "yes", "v0", "v1", "v3"});
25  parameter_set_.add(NonLocalMove, "nonlocalmoves", {"no", "yes", "v0", "v1", "v3"});
26  parameter_set_.add(max_age_, "MaxAge");
27  parameter_set_.add(feedback_, "feedback");
28  parameter_set_.add(refE_update_scheme_str, "refenergy_update_scheme", {"unlimited_history", "limited_history"});
29 
30  // from DMC.cpp put(xmlNodePtr)
31  parameter_set_.add(branch_interval_, "branchInterval");
32  parameter_set_.add(branch_interval_, "branchinterval");
33  parameter_set_.add(branch_interval_, "substeps");
34  parameter_set_.add(branch_interval_, "subStep");
35  parameter_set_.add(branch_interval_, "sub_stepd");
36 
37  //from NonLocalTOperator.cpp
38  parameter_set_.add(alpha_, "alpha");
39  parameter_set_.add(gamma_, "gamma");
40 
41  parameter_set_.add(reserve_, "reserve");
42 
43  parameter_set_.put(node);
44 
45  if (reconfig_str == "yes")
46  throw std::runtime_error("Reconfiguration is currently broken and gives incorrect results. Use dynamic "
47  "population control by setting reconfiguration=\"no\" or removing the reconfiguration "
48  "option from the DMC input section. If accessing the broken reconfiguration code path "
49  "is still desired, set reconfiguration to \"runwhileincorrect\" instead of \"yes\".");
50  reconfiguration_ = (reconfig_str == "yes");
51 
52  if (NonLocalMove == "yes" || NonLocalMove == "v0")
53  app_summary() << " Using Non-local T-moves v0, M. Casula, PRB 74, 161102(R) (2006)";
54  else if (NonLocalMove == "v1")
55  app_summary() << " Using Non-local T-moves v1, M. Casula et al., JCP 132, 154113 (2010)";
56  else if (NonLocalMove == "v3")
57  app_summary() << " Using Non-local T-moves v3, an approximation to v1";
58  else
59  app_summary() << " Using Locality Approximation";
60  app_summary() << std::endl;
61 
62  // TODO: similar check for alpha and gamma
63  if (max_age_ < 0)
64  throw std::runtime_error("Illegal input for MaxAge in DMC input section");
65  if (branch_interval_ < 0)
66  throw std::runtime_error("Illegal input for branchInterval or substeps in DMC input section");
67 
68  if (reserve_ < 1.0)
69  throw std::runtime_error("You can only reserve walkers above the target walker count");
70 
71  if (refE_update_scheme_str == "unlimited_history")
73  else
75 }
RealType reserve_
reserved walkers for population growth
double feedback_
feed back parameter for population control
if(!okay) throw std xmlNodePtr node
std::ostream & app_summary()
Definition: OutputManager.h:63
IndexType branch_interval_
Do not write out blocks of gets for variables like this there is are code_generation tools in QMCPA...
DMCRefEnergyScheme refenergy_update_scheme_
input std::string to determine reference energy update scheme
bool reconfiguration_
reconfiguration flag
IndexType max_age_
input to control maximum age allowed for walkers.
bool put(std::istream &is) override
read from std::istream
Definition: ParameterSet.h:42
class to handle a set of parameters
Definition: ParameterSet.h:27
std::string NonLocalMove
input std::string to determine to use nonlocal move
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>

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  o_stream,
const DMCDriverInput vmci 
)
friend

Definition at line 77 of file DMCDriverInput.cpp.

77 { return o_stream; }

Member Data Documentation

◆ alpha_

double alpha_ = 0.0
private

Definition at line 68 of file DMCDriverInput.h.

Referenced by DMCDriverInput::get_alpha(), and DMCDriverInput::readXML().

◆ branch_interval_

IndexType branch_interval_ = 1
private



Do not write out blocks of gets for variables like this there is are code_generation tools in QMCPACK_ROOT/utils/code_tools

Interval between branching

Definition at line 51 of file DMCDriverInput.h.

Referenced by DMCDriverInput::get_branch_interval(), and DMCDriverInput::readXML().

◆ feedback_

double feedback_ = 1.0
private

feed back parameter for population control

Definition at line 53 of file DMCDriverInput.h.

Referenced by DMCDriverInput::get_feedback(), and DMCDriverInput::readXML().

◆ gamma_

double gamma_ = 0.0
private

Definition at line 69 of file DMCDriverInput.h.

Referenced by DMCDriverInput::get_gamma(), and DMCDriverInput::readXML().

◆ KillWalker

std::string KillWalker
private

input std::string to determine kill walkers or not

Definition at line 57 of file DMCDriverInput.h.

◆ max_age_

IndexType max_age_ = 10
private

input to control maximum age allowed for walkers.

Definition at line 65 of file DMCDriverInput.h.

Referenced by DMCDriverInput::get_max_age(), and DMCDriverInput::readXML().

◆ NonLocalMove

std::string NonLocalMove
private

input std::string to determine to use nonlocal move

Definition at line 63 of file DMCDriverInput.h.

Referenced by DMCDriverInput::get_non_local_move(), and DMCDriverInput::readXML().

◆ reconfiguration_

bool reconfiguration_ = true
private

reconfiguration flag

Definition at line 61 of file DMCDriverInput.h.

Referenced by DMCDriverInput::get_reconfiguration(), and DMCDriverInput::readXML().

◆ refenergy_update_scheme_

DMCRefEnergyScheme refenergy_update_scheme_
private

input std::string to determine reference energy update scheme

Definition at line 55 of file DMCDriverInput.h.

Referenced by DMCDriverInput::get_refenergy_update_scheme(), and DMCDriverInput::readXML().

◆ reserve_

RealType reserve_ = 1.0
private

reserved walkers for population growth

Definition at line 67 of file DMCDriverInput.h.

Referenced by DMCDriverInput::get_reserve(), and DMCDriverInput::readXML().

◆ SwapWalkers

std::string SwapWalkers
private

input std::string to determine swap walkers among mpi processors

Definition at line 59 of file DMCDriverInput.h.


The documentation for this class was generated from the following files: