Store current system state upon program termination
If POSIX signal TERM is received, an exception is thrown in wrap_abort() (observables::sampler) and the simulation aborts immediately. At least, the HDF5 output files are left in a healthy state.
In addition, it would be nice to write the current state of the particle data and accumulators to the output file. I suggest to provide a signal on_terminate to sampler() which is triggered before the exception is thrown.
Most of the observable modules could then connect to this signal (phase_space, thermodynamics, blocking_scheme).