proteus icon indicating copy to clipboard operation
proteus copied to clipboard

implement proper signal handling in C code

Open cekees opened this issue 10 years ago • 3 comments

May be able to follow what petsc4py is doing.

cekees avatar May 06 '14 19:05 cekees

No guarantees that petsc4py is doing this, I just know that PETSc registers signal handlers. Lisandro would know.

ahmadia avatar May 06 '14 20:05 ahmadia

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.

cekees avatar Sep 05 '15 20:09 cekees

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?

adimako avatar Jan 21 '19 17:01 adimako