SpectralSequences / sseq

The root repository for the SpectralSequences project.
Apache License 2.0
25 stars 10 forks source link

Delete open files when ctrl-c received #88

Closed dalcde closed 2 years ago

dalcde commented 2 years ago

Partially fixes #79 .

@JoeyBF comments?

dalcde commented 2 years ago

There are other things we might want to do when we get terminated, e.g. wait for existing writes to complete. This might be very problematic for nassau where we open a file for a long time. We can also wait for all existing computations to complete, but that is harder to do in a uniform way, and may take quite a while before things actually terminate.

JoeyBF commented 2 years ago

I like it! I might want to switch ctrlc for something like signal-hook in the future, to handle the other signals. FWIW, slurm kills processes with a SIGTERM instead of a SIGINT. Also, the grace period before issuing a SIGKILL is 30 seconds by default.

dalcde commented 2 years ago

The termination feature makes it handle SIGTERM as well as SIGINT.