Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kill (and nicely escape) ddsim applications with CTRL-C #1330

Closed
BrieucF opened this issue Oct 15, 2024 · 3 comments
Closed

Kill (and nicely escape) ddsim applications with CTRL-C #1330

BrieucF opened this issue Oct 15, 2024 · 3 comments

Comments

@BrieucF
Copy link
Contributor

BrieucF commented Oct 15, 2024

It would be really nice to be able to kill a ddsim job with CTRL-C, and even better, to abort the event loop (if started already) but still producing a sane output file with the events processed so far (similar to the behavior of StopOnSignal=True from Gaudi ApplicationMgr).

Would that be possible?

I see a proposal here #1300 but it would only cover the detector loading stage IIUC.

@MarkusFrankATcernch
Copy link
Contributor

Yes. This could be done in principle.
But it is not entirely obvious.

Also the approach in #1300 brutally stops executing when CTRL-C (SIGINT) is hit. We could provide a module, which can be loaded on user request from python and then instruments the Geant4 interface. However, there would be a couple of consequences in the event loop:

  • The event loop would have to be called for one event at a time.
  • During the simulation of one single event signal handling would have to be suspended, because typically throwing an exception causes a Geant4 crash. Hence one event must finish before the event loop could be broken.
  • Should finalization be interruptible ? Don't know. Output files may very well be corrupted.
  • During initialization the signal handling can stop the program at any time, because no data need to be saved.

What other requirements would there be to properly handle signals. Any plans for other signals (SIGSTOP / SIGCONT, etc...)

@MarkusFrankATcernch
Copy link
Contributor

This issue can be closed I think. The problem is addressed in MR #1336

@BrieucF
Copy link
Contributor Author

BrieucF commented Oct 24, 2024

Indeed, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants