.. Generated automatically by cpp2rst .. highlight:: c .. role:: red .. role:: green .. role:: param .. _triqs__mc_tools__mc_generic__run: triqs::mc_tools::mc_generic::run ================================ *#include * **Synopsis** .. rst-class:: cppsynopsis | int :red:`run` (int64_t :param:`n_cycles`, | int64_t :param:`length_cycle`, | std::function :param:`stop_callback`, | bool :param:`do_measure`, | :ref:`communicator ` :param:`c` = mpi::communicator{}) Generic function to run the Monte-Carlo. Used by both warmup and accumulate. Parameters ^^^^^^^^^^ * :param:`n_cycles` Number of QMC cycles If negative, the accumulation is done until the stop_callback returns true or signal is received. * :param:`length_cycle` Number of QMC move attempts in one cycle * :param:`stop_callback` A callback function () -> bool. It is called after each cycle to and the computation stops when it returns true. Typically used to set up the time limit, cf doc. * :param:`do_measure` Whether or not to accumulate for each measurement * :param:`c` The mpi communicator [optional]. If not provided use the default-constructed one. Returns ^^^^^^^ = ============================================= 0 if the computation has run until the end 1 if it has been stopped by stop_callback 2 if it has been stopped by receiving a signal = =============================================