Signals
Parthenon handles several operating system signals. Generally, it attempts
to exit gracefully (saving simulation state), but upon receiving repeated
signals it will exit immediately like any other program.
If
Parthenoncatches aSIGINT,SIGTERM, orSIGALRM, it will attempt to exit gracefully at the end of the current step, after outputting anyfinalsimulation output files. These are the signals sent with^C, by Slurm when a job has reached its walltime limit, or after the time specified on the command line with-t HH:MM:SS.If
Parthenoncatches threeSIGINTorSIGTERMsignals during a single step, it will exit immediately with aPARTHENON_ERROR. So, if an application is misbehaving, threeSIGINT``s with ``^Cwill end it immediately.
In addition to signals, Parthenon applications will react to special files
placed in the output directory.
Creating/touching a new file with the name
output_nowin the working directory of a running application will cause it to write output files with anowid rather than a number. After the output is written. theoutput_nowfile is removed and the simulation continues normally. The user can repeat the process any time by creating a newoutput_nowfile.Creating a file named
stop_nowwill stop a running simulation at the end of the current step, in exactly the same way as sending a singleSIGINT.
Signal handling is implemented in utils/signal_handler.cpp.