![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
#include <line/util/line_console.h>
Classes | |
| class | Run |
| RAII guard: opens a run on construction, closes it on scope exit. More... | |
| class | Quiet |
| RAII guard that suppresses structure-compile detail while it lives. More... | |
| class | OwnModelCompile |
| Lift the compile detail rule while the run compiles its OWN model. More... | |
Static Public Member Functions | |
| static void | set_verbose (VerboseLevel level) |
| Set the session verbosity. | |
| static VerboseLevel | get_verbose () |
| The session verbosity. | |
| static void | reset () |
| Forget any open run (used after an interrupted solve). | |
| static bool | wanted (bool verbose=true) |
| Resolve whether a run should narrate. | |
| static bool | is_active () |
| True while a run is narrating; gates SUPPRESSION of legacy prints. | |
| static bool | owns_log () |
| True only inside the OUTERMOST open run; gates EMISSION. | |
| static bool | writes () |
| True when a progress line should be printed: either the outermost run is narrating, or no run is open and the session is at DEBUG – the second case is what lets model construction narrate before any solver exists. | |
| static bool | begin_run (const std::string &tag, const std::string &model_name, bool verbose=true) |
| Open a console run. | |
| static void | setup_done () |
| Mark the end of the setup phase, so the closing line can split the time. | |
| static void | end_run () |
| Close the innermost open run, writing the closing line. | |
| static void | step (const char *fmt,...) |
| Write one progress line. | |
| static void | substep (const char *fmt,...) |
| Write one indented progress line. | |
| static void | compile_detail (const char *fmt,...) |
| One stage line of a structure compile: silenced inside a Quiet scope, and inside an open run, where the structures compiled are those of auxiliary models rather than of the model under study. | |
| static void | compiling (const std::string &name) |
| Announce the compilation of a model structure. | |
| static void | loop (const char *fmt,...) |
| Announce an iteration loop and reset its reporting budget. | |
| static void | iter (long k, const char *fmt,...) |
Report iteration k of the current loop. | |
| static std::string | plural (long n, const std::string &singular, const std::string &plural_form) |
| Count with an agreeing noun, e.g. | |
Definition at line 59 of file line_console.h.
|
inlinestatic |
Open a console run.
Pair with end_run(), or use the Run guard below so that a failed analysis still reports what it had reached.
| tag | short solver name, e.g. "MVA" |
| model_name | the model under study |
| verbose | the run's own verbosity flag |
Definition at line 139 of file line_console.h.
References wanted().
Referenced by line::util::LineConsole::Run::Run().
|
inlinestatic |
One stage line of a structure compile: silenced inside a Quiet scope, and inside an open run, where the structures compiled are those of auxiliary models rather than of the model under study.
Definition at line 252 of file line_console.h.
References writes().
Referenced by line::qn::NetworkStruct< T >::refresh_struct().
|
inlinestatic |
Announce the compilation of a model structure.
A run opened before the model file was read carries no model name yet (the CLI knows the solver method name first), so the FIRST compile inside such a run names the run: it is the model under study, not an auxiliary one.
Definition at line 271 of file line_console.h.
References step().
Referenced by line::qn::NetworkStruct< T >::refresh_struct().
|
inlinestatic |
Close the innermost open run, writing the closing line.
Definition at line 180 of file line_console.h.
References reset(), and step().
Referenced by line::util::LineConsole::Run::~Run().
|
inlinestatic |
The session verbosity.
Definition at line 70 of file line_console.h.
|
inlinestatic |
True while a run is narrating; gates SUPPRESSION of legacy prints.
Definition at line 109 of file line_console.h.
|
inlinestatic |
Report iteration k of the current loop.
The first 20 iterations report in full, then every 10th, and the loop stops after 30 lines so a long run cannot bury the rest of the narration.
Definition at line 344 of file line_console.h.
References owns_log().
Referenced by line::ssa::NrmEngine< T >::run(), line::mva::solver_amvald(), and line::fluid::solver_fluid_moments().
|
inlinestatic |
Announce an iteration loop and reset its reporting budget.
Re-announcing the SAME text (a solver that restarts its loop) neither reprints the header nor refills the budget.
Definition at line 325 of file line_console.h.
References owns_log().
Referenced by line::ssa::NrmEngine< T >::run(), line::mva::solver_amvald(), and line::fluid::solver_fluid_moments().
|
inlinestatic |
True only inside the OUTERMOST open run; gates EMISSION.
Definition at line 112 of file line_console.h.
Referenced by line::mva::fj_fixed_point(), iter(), loop(), line::mva::solver_amvald(), and writes().
|
inlinestatic |
Count with an agreeing noun, e.g.
"1 chain" or "3 chains".
Definition at line 364 of file line_console.h.
Referenced by line::qn::NetworkStruct< T >::refresh_struct().
|
inlinestatic |
Forget any open run (used after an interrupted solve).
Definition at line 73 of file line_console.h.
Referenced by end_run(), and set_verbose().
|
inlinestatic |
Set the session verbosity.
DEBUG is what switches the console on.
Definition at line 64 of file line_console.h.
References reset().
Referenced by main().
|
inlinestatic |
Mark the end of the setup phase, so the closing line can split the time.
Definition at line 174 of file line_console.h.
|
inlinestatic |
Write one progress line.
Definition at line 228 of file line_console.h.
References writes().
Referenced by compiling(), end_run(), line::mva::fj_fixed_point(), line::nc::nc_dispatch(), line::lqns::SolverLQNS< T >::run_analyzer(), line::ctmc::solve_struct(), line::ctmc::solver_ctmc(), line::jmt::solver_jmt_run_analyzer(), line::ldes::solver_ldes_text(), line::nc::solver_nc_run_analyzer(), and line::qns::solver_qns_run_analyzer().
|
inlinestatic |
Write one indented progress line.
Definition at line 238 of file line_console.h.
References writes().
Referenced by line::jmt::solver_jmt_run_analyzer().
|
inlinestatic |
Resolve whether a run should narrate.
THE CONSOLE IS DEBUG, and this is the whole rule: a run narrates when the session is at DEBUG and at no lower level. The run's own verbose flag still vetoes – it spells SILENT when false, and a run asked to stay silent stays silent whatever the session asks for – but it cannot switch the console ON, because true there means STD, not DEBUG.
Definition at line 104 of file line_console.h.
References line::util::DEBUG.
Referenced by begin_run().
|
inlinestatic |
True when a progress line should be printed: either the outermost run is narrating, or no run is open and the session is at DEBUG – the second case is what lets model construction narrate before any solver exists.
Definition at line 122 of file line_console.h.
References line::util::DEBUG, and owns_log().
Referenced by compile_detail(), step(), and substep().