Logs and Signal handling
-
Feature description was added to the changelog -
Tests covering your feature were added? -
Any new feature or behaviour change was documented?
- This MR is related to an MR in OGSTools
- It changes some log outputs to
- allow real-time monitoring of the progress of OGS with the OGSTools Logparser
- Therefore it needs:
- additional log outputs for the current context that is sometimes missing, are outputted too late (e.g. the number of current non-linear solver iteration was logged when the iteration finished, NOW it is logged in the beginning and in the end
- context: e.g. time step, non-linear solver iteration, process, ...
- Minimal structure
- all context is opened ("started") and closed
- special case (e.g. time step 0) is normalized (behaves like any other time step)
- Producer consumer pattern
- Finalization token (that signal to the producer / consumer that the simulation has ended (either successfully or with error)
- Signal - handling
- Ctrl+C (Interrupt)
- Ctrl+\ (Quit)
- pkill -SIGTERM <process_id> (Terminate)
- It will not (and can never) work for SIGKILL
- additional log outputs for the current context that is sometimes missing, are outputted too late (e.g. the number of current non-linear solver iteration was logged when the iteration finished, NOW it is logged in the beginning and in the end
- Introduces a new command line option to
ogs
:log-parallel
- e.g.
ogs my.prj --log-parallel
- with MPI, without new flag: only rank 0 prints to log
- with MPI, with new flag: legacy behaviour: all ranks print into same log file
- without MPI: legacy behaviour /flag has no effect
- e.g.
Edited by Tobias Meisel