kicad2ems.gui.meters

Live memory for the GUI's status bar (no Qt here: testable without a display).
All cheap enough to read every couple of seconds; the GPU through its vendor's
tool, run by the caller as a separate process, so the GUI never holds a GPU
context or imports CuPy.

    ram()  (used, total) GB of the system (Linux: /proc/meminfo; Windows:
           GlobalMemoryStatusEx; elsewhere what sysconf gives)
    tree_rss(pid)  GB resident in a process and its children (Linux), or None
    gpu_command()  [program, args...] that prints the GPU's memory (nvidia-smi /
                   rocm-smi), or None
    parse_gpu(name, text)  [(used, total) GB per GPU] from that program's output
    estimate(est, values, usable)  what the next run should take: the solvers it
                                   runs, their time and memory
kicad2ems.gui.meters.duration(sec)[source]
A short duration: ~40 s, ~4 min, ~1.5 h.
kicad2ems.gui.meters.estimate(est, values, usable=None, ram_avail=None)[source]
What the next run should take, from a preview's estimates
(summary['estimates']: {solvers: {name: dict( seconds, gb, gpu_gb)}}) and
the form's settings (values: solvers as runner.solvers_from_form makes
them).

The full-wave solvers it runs, as the pipeline picks them: those named, or
for auto (the default) when none is named the one auto would pick, the
fastest of those that can run here (usable: names, None for all) and fit in
80 % of ram_avail GB. Returns dict(rows=[(name, seconds, gb, gpu_gb, auto)],
seconds (summed: they run one after the other), gb (the largest), gpu_gb,
fits, missing (named solvers without an estimate)), or None when no
full-wave solver would run or none has an estimate.
kicad2ems.gui.meters.gpu_command()[source]
The command that prints the GPU's memory use: nvidia-smi (NVIDIA) or
rocm-smi (AMD); None without either.
kicad2ems.gui.meters.parse_gpu(prog, text)[source]
[(used GB, total GB)] per GPU from gpu_command's output (prog: its
program name); [] when it can't be read.
kicad2ems.gui.meters.ram(meminfo='/proc/meminfo')[source]
(used, total) of the system's memory in GB: used = total - available
(what other programs can still have). None where neither /proc/meminfo,
Windows nor sysconf can tell.
kicad2ems.gui.meters.tree_rss(pid, proc='/proc')[source]
GB resident in a process and all its descendants (a run: the kicad2ems
process, its --jobs workers and openEMS); None where /proc cannot tell (not
Linux, or the process is gone).