proteus
proteus copied to clipboard
implement proper signal handling in C code
May be able to follow what petsc4py is doing.
No guarantees that petsc4py is doing this, I just know that PETSc registers signal handlers. Lisandro would know.
This is pretty low priority bit of functionality since the xdmf archive is rarely left in an unusable state, but it may happen more often as we scale up to larger core counts and writes take longer. As a practical solution, I think we need two things
- A simple signal handler that will catch a user signal (e.g. USR1) and cleanly exit the time stepping loop (e.g. https://pymotw.com/2/signal/), thus allowing a user to signal a soft exit.
- A time limit option to parun that will cleanly shutdown time stepping and close files before some outside system kills the run uncleanly.
I do not recommend closing this one. I like the idea of a time limit that prevents the code from hanging to a timestep for e.g. a day or so. @cekees @tridelat?