QMCPACK
QMCDriverInput.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2020 QMCPACK developers.
6 //
7 // File developed by: Peter Doak, doakpw@ornl.gov, Oak Ridge National Laboratory
8 //
9 // File refactored from: QMCDriver.cpp
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 #ifndef QMCPLUSPLUS_QMCDRIVERINPUT_H
13 #define QMCPLUSPLUS_QMCDRIVERINPUT_H
14 
15 #include <optional>
16 
17 #include "Configuration.h"
18 #include "OhmmsData/ParameterSet.h"
19 #include "InputTypes.hpp"
20 #include "DriverDebugChecks.h"
21 #include "EstimatorManagerInput.h"
23 
24 namespace qmcplusplus
25 {
26 /** Input representation for Driver base class runtime parameters
27  */
29 {
30 public:
34 
35  void readXML(xmlNodePtr cur);
36 
37  // To allow compile check if move constructor is still implicit
38  QMCDriverInput() = default;
39  QMCDriverInput(const QMCDriverInput&) = default;
40  QMCDriverInput& operator=(const QMCDriverInput&) = default;
41  QMCDriverInput(QMCDriverInput&&) noexcept;
42  QMCDriverInput& operator=(QMCDriverInput&&) noexcept;
43 
44 protected:
45  bool scoped_profiling_ = false;
46  /// determine additional checks for debugging purpose
48  /// measure load imbalance (add a barrier) before data aggregation (obvious synchronization)
49  bool measure_imbalance_ = false;
50 
51  /** @ingroup Input Parameters for QMCDriver base class
52  * @{
53  * All input determined variables should be here
54  * They are read only for Drivers
55  * Do not write out blocks of gets for variables like this
56  * there will be code generation snippets soon in utils
57  */
58 
59  /// if true, batched operations are serialized over walkers
61  /// period to recalculate the walker properties from scratch.
63  /// period of recording walker positions and IDs for forward walking afterwards
64  input::PeriodStride config_dump_period_;
67  // This is the global walkers it is a hard limit for VMC and the target for DMC
72  // max unnecessary in this context
74  // if 0, the actual value will be decided later by the driver
77  RealType tau_ = 0.1;
79  // call recompute at the end of each block in the full/mixed precision case.
81  bool append_run_ = false;
82 
83  // from QMCDriverFactory
84  std::string qmc_method_{"invalid"};
85  std::string update_mode_{"pbyp"};
86 
87  /** The EstimatorManagerInput for batched version input
88  */
89  std::optional<EstimatorManagerInput> estimator_manager_input_;
90 
91  // from putQMCInfo
92  input::PeriodStride walker_dump_period_{0, 0};
93  input::PeriodStride check_point_period_{0, 0};
94  bool dump_config_ = false;
96  bool reset_random_ = false;
97 
98  // from QMCUpdateBase
100 
101  // for drift modifer
102  std::string drift_modifier_{"UNR"};
104 
105  /** @}
106  */
107 
108 public:
110  input::PeriodStride get_config_dump_period() const { return config_dump_period_; }
116  IndexType get_sub_steps() const { return sub_steps_; }
121  RealType get_tau() const { return tau_; }
122  RealType get_spin_mass() const { return spin_mass_; }
124  bool get_append_run() const { return append_run_; }
125  input::PeriodStride get_walker_dump_period() const { return walker_dump_period_; }
126  input::PeriodStride get_check_point_period() const { return check_point_period_; }
127  IndexType get_k_delay() const { return k_delay_; }
128  bool get_reset_random() const { return reset_random_; }
129  bool get_dump_config() const { return dump_config_; }
131  const std::string& get_qmc_method() const { return qmc_method_; }
132  const std::string& get_update_mode() const { return update_mode_; }
134  bool get_scoped_profiling() const { return scoped_profiling_; }
136  bool get_measure_imbalance() const { return measure_imbalance_; }
138  const std::string get_drift_modifier() const { return drift_modifier_; }
141  const std::optional<EstimatorManagerInput>& get_estimator_manager_input() const { return estimator_manager_input_; }
142 };
143 
144 // These will cause a compiler error if the implicit move constructor has been broken
145 inline QMCDriverInput::QMCDriverInput(QMCDriverInput&&) noexcept = default;
146 inline QMCDriverInput& QMCDriverInput::operator=(QMCDriverInput&&) noexcept = default;
147 
148 } // namespace qmcplusplus
149 
150 #endif
input::PeriodStride get_config_dump_period() const
input::PeriodStride check_point_period_
QMCTraits::RealType RealType
RealType get_max_disp_sq() const
RealType get_drift_modifier_unr_a() const
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
declares the list supported estimator input types and declares the input type for EstimatorManagerNew...
QTBase::RealType RealType
Definition: Configuration.h:58
std::optional< EstimatorManagerInput > estimator_manager_input_
The EstimatorManagerInput for batched version input.
QMCDriverInput & operator=(const QMCDriverInput &)=default
IndexType get_starting_step() const
IndexType get_requested_steps() const
input::PeriodStride get_walker_dump_period() const
DriverDebugChecks debug_checks_
determine additional checks for debugging purpose
bool is_same(const xmlChar *a, const char *b)
IndexType get_sub_steps() const
DriverDebugChecks get_debug_checks() const
input::PeriodStride config_dump_period_
period of recording walker positions and IDs for forward walking afterwards
QMCTraits::FullPrecRealType FullPrecisionRealType
IndexType get_num_crowds() const
IndexType get_total_walkers() const
bool measure_imbalance_
measure load imbalance (add a barrier) before data aggregation (obvious synchronization) ...
IndexType get_walkers_per_rank() const
RealType get_spin_mass() const
input::PeriodStride walker_dump_period_
const std::string get_drift_modifier() const
IndexType get_k_delay() const
OHMMS_INDEXTYPE IndexType
define other types
Definition: Configuration.h:65
int recalculate_properties_period_
period to recalculate the walker properties from scratch.
const std::optional< EstimatorManagerInput > & get_estimator_manager_input() const
input::PeriodStride get_check_point_period() const
void readXML(xmlNodePtr cur)
Reads qmc section xml node parameters.
const std::string & get_update_mode() const
bool crowd_serialize_walkers_
All input determined variables should be here They are read only for Drivers Do not write out bloc...
IndexType get_warmup_steps() const
IndexType get_max_blocks() const
QTFull::RealType FullPrecRealType
Definition: Configuration.h:66
IndexType get_blocks_between_recompute() const
IndexType get_requested_samples() const
QMCTraits::IndexType IndexType
const std::string & get_qmc_method() const
Input representation for Driver base class runtime parameters.
int get_recalculate_properties_period() const