kicad2ems.fem.children¶
The solvers a tool starts (ElmerGrid, ElmerSolver, Palace with its MPI ranks,
podman), each in a process group of its own and stopped with the tool: on the
tool's SIGTERM (the window's Stop), at its exit, and when the run's stop is
requested (kicad2ems.core.stop: a Palace driven run inside kicad2ems, whose STOP
file the window writes). Started plainly, they outlived a Stop: 8 Palace ranks
went on for their half hour.
p = popen(cmd, **kw) # subprocess.Popen in a session of its own,
# watched as above
r = run(cmd, timeout=None) # subprocess.run's result (text captured); a
# timeout stops it: RuntimeError
stopped(p) # whether it was stopped for a stop request
# (raise_stopped then)
guard() # in a tool's main: SIGTERM stops its solvers,
# then the tool
- kicad2ems.fem.children.guard()[source]¶
In a tool's main: its solvers stopped with it, on SIGTERM (the window's Stop: the tool then exits 143) and at its exit.
- kicad2ems.fem.children.popen(cmd, **kw)[source]¶
subprocess.Popen(cmd, **kw) in a session of its own (POSIX), stopped with the tool and on a stop request.
- kicad2ems.fem.children.raise_stopped()[source]¶
kicad2ems.core.stop.Stopped: the run gives no result.
- kicad2ems.fem.children.run(cmd, timeout=None, cwd=None, env=None)[source]¶
subprocess.run(cmd, capture_output=True, text=True)'s result, the solver started as popen's. A timeout stops it and raises RuntimeError saying so (subprocess.TimeoutExpired had escaped the tools' main); a stop request, raise_stopped.