Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5049

Save system configuration if python thread gets killed

$
0
0

I have a Python script to simulate particle dynamics. The simulations are long (can take up to a month). I save my data with a given frequency. Unfortunately, I had to kill the simulations, and lost a lot of information that I sample at the very end of the simulation, when the main loop is done and the number of simulation steps exhausted.

I would like to know if there is a way in Python to save my last configuration if the work gets killed. That is, if I write in the terminal

 killall python 

or

kill (id number of the job)

can I trigger something so that my last system configuration gets saved in a file? Can the same be done if some error arises?


Viewing all articles
Browse latest Browse all 5049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>