Signal handling - SIGTERM will stop calculation and force file saving#2110
Signal handling - SIGTERM will stop calculation and force file saving#2110pcarruscag merged 23 commits intodevelopfrom
Conversation
|
Here is a simple proof-of-concept for the fluid iteration where we catch SIGTERM. If you run it and hit ctrl-c, we catch the signal and we set stopcalc to true. This will exit the for-loop and also forces a saving of the files. |
|
We probably also have to do something like this at other places where we have external iterations. |
pcarruscag
left a comment
There was a problem hiding this comment.
This should be at the driver level, not inside iteration classes otherwise it won't work for multizone.
How are signals handled by MPI? Can this result in a race condition?
|
OK, so I am moving the signal handling to COutput::ConvergenceMonitoring as discussed in the dev-meeting. |
|
@pcarruscag This works for me. Do you think this is OK or we need to do it different/more, maybe a config keyword to activate/deactivate, or other options? |
pcarruscag
left a comment
There was a problem hiding this comment.
I have not had time to test it for single/multi zone, steady/unsteady, and primal/adjoint.
Proposed Changes
Special signal handling for SIGTERM. When SIGTERM is sent to the solver, we catch it and simply exit the for-loop for the number of iterations. Files will then automatically be saved.
Related Work
Related to Github discussion #2094
PR Checklist
Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.