trixi-framework / trixi-framework/Trixi.jl

Graceful exit on aborting a simulation with Ctrl-C

Open
#1,876 5 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Julia
Stars
731
Forks
166
Avg merge
2d 18h
Merged PRs (30d)
25

Description

Raise your hands if you haven't encountered this situation at least once before:

You tinker with a new feature implementation and/or simulation setup.
Finally, you get it to run.
For good measure, you wait a while to make sure it does not crash.
Satisfied, you hit Ctrl-C to abort
Now, you'd really like to look at the results using Plots.jl/Makie.jl.

But, alas, there is no way to visualize the result easily from within Julia because you do not have a `sol` object yet!

What I thus propose is to investigate possible ways to allow a "graceful abort" (an oxymoron if there ever was one) when running simulations from the REPL, discuss them, and then implement them for Trixi.jl. Ideally, I'd be looking at something like the following setup:

* Hit Ctrl-C once and only once: Get a graceful exist after the next time step has finished. A soothing message to the user informs them of what an excellent choice they made in not hitting Ctrl-C multiple times out of frustration, and if they wait juuuust a little longer, they get a proper `sol` object.
* Hit Ctrl-C repeatedly: Get out of dodge, and fast (i.e., as it does right now).
* Obviously, there is no measurable performance impact for but the tiniest of simulation setups
* It just "works" without user interaction

Contributor guide

Open the contributing guide

Research direction

Start by investigating how Ctrl-C is handled during Trixi.jl simulations launched from the Julia REPL; the issue does not name specific files or tests. Compare a single interrupt with repeated interrupts. Done means one interrupt finishes the next time step and returns a usable sol object, while repeated interrupts still exit quickly without measurable impact on tiny simulations.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.