Brief collection of code snippets that implement minimal working examples for various situations of interest.
example_mp.py: parallel execution of function using python multiprocess package. Includes signal handling when SIGTERM or SIGINT signals are received such that program exits gracefully and automatically restarts (via sbatch).plot_example.py: matplotlib script to plot the output ofexample_mp.pyjob-example-did2.py: slurm script to start and restartexample_mp.pyprogram on AL didymium-2 cluster.
Thanks for helpful discussions and explanations to Noah Berthusen (Iowa State University), Thomas Koschny (Ames Laboratory), Yongxin Yao (Ames Laboratory).