I have a rudimentary SIGTERM handler in the main script / module of my code that deletes temporary files if the job is canceled by a cluster scheduler, e.g. scancel on slurm