TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
triqs::mc_tools::mc_generic< MCSignType >::run_param_t

#include <triqs/mc_tools/mc_generic.hpp>

Detailed Description

template<DoubleOrComplex MCSignType>
struct triqs::mc_tools::mc_generic< MCSignType >::run_param_t

User-provided MC simulation parameters for the run() method.

Definition at line 103 of file mc_generic.hpp.

Public Attributes

std::function< void()> after_cycle_duty = []() {}
 Callback function that is executed after each of the first ncycles cycles.
double check_cycles_interval = 1
 Time interval (in seconds) after which the simulation checks if all other nodes have finished their cycles.
double check_exception_interval = 1
 Time interval (in seconds) after which the simulation checks for exceptions on other nodes.
mpi::communicator comm = mpi::communicator{}
 MPI communicator.
bool continue_after_ncycles_done = true
 Should we continue the simulation on the current rank after the given number of cycles is done and wait for all other ranks to finish as well or should we stop immediately?
std::int64_t cycle_length = 1
 Number of MC steps/moves per cycle.
bool enable_calibration = false
 Should we calibrate the moves during the simulation? Usually false during the accumulation phase.
bool enable_measures = true
 Should we take measurements during the simulation? Usually false during the warmup phase.
MCSignType initial_sign = default_initial_sign
 The sign of the MC weight is initialized to this value before the simulation starts (if it is != default_initial_sign).
std::int64_t ncycles = -1
 Number of MC cycles to run (< 1 to run indefinitely).
mc_phase phase = mc_phase::accumulation
bool propagate_exception = true
 Should we propagate exceptions to all MPI ranks or abort the simulation immediately?
std::function< bool()> stop_callback = []() { return false; }
 Optional callback function that returns a boolean value indicating if we should stop the simulation. Executed at the end of each cycle.

Member Data Documentation

◆ after_cycle_duty

template<DoubleOrComplex MCSignType>
std::function<void()> triqs::mc_tools::mc_generic< MCSignType >::run_param_t::after_cycle_duty = []() {}

Callback function that is executed after each of the first ncycles cycles.

Not executed during overtime cycles (see continue_after_ncycles_done), so it runs exactly ncycles times on every rank and may therefore safely contain MPI communication.

Definition at line 131 of file mc_generic.hpp.

◆ continue_after_ncycles_done

template<DoubleOrComplex MCSignType>
bool triqs::mc_tools::mc_generic< MCSignType >::run_param_t::continue_after_ncycles_done = true

Should we continue the simulation on the current rank after the given number of cycles is done and wait for all other ranks to finish as well or should we stop immediately?

Defaults to true so that ranks which finish early keep doing useful work (e.g. accumulating measurements) instead of idling at the collect_results barrier. Only has an effect under an MPI environment (see mpi::has_env); set to false to recover the legacy behavior of stopping exactly at ncycles.

Overtime cycles perform moves and measurements only: after_cycle_duty and move calibration stop after ncycles, so per-cycle MPI communication (e.g. a collective move calibrate) stays in lockstep across ranks and cannot deadlock on the rank-dependent number of overtime cycles.

Definition at line 158 of file mc_generic.hpp.

◆ phase

template<DoubleOrComplex MCSignType>
mc_phase triqs::mc_tools::mc_generic< MCSignType >::run_param_t::phase = mc_phase::accumulation

Simulation phase, selecting whether the elapsed time is recorded as warmup or accumulation time. Decoupled from enable_measures so that a measuring run() can still be timed as warmup.

Definition at line 144 of file mc_generic.hpp.


The documentation for this struct was generated from the following file: