Feature #13852
Stop event loop dynamically end exit with status 0
0%
Description
One of our NOvA user asked how to make art job finish when it finds certain kinds of event. Currently art stops the event loop in the following circumstances:
//------------------------------------------------------------------ // The function "runToCompletion" will run until the job is "complete", // which means: // 1 - no more input data // 2 - input maxEvents parameter limit reached // 3 - output maxEvents parameter limit reached // 4 - input maxSubRuns parameter limit reached // // The return values from runToCompletion are as follows: // epSignal - processing terminated early, SIGUSR2 encountered // epSuccess - all other cases
We would like a feature similar as raising "SIGUSER1" and making runToCompletion return epSuccess.
History
#1 Updated by Marc Paterno over 4 years ago
- Status changed from New to Feedback
- SSI Package art added
- SSI Package deleted (
)
There is a solution possible with no changes in art. If a NOvA module were to send a SIGINT signal to its own process (use process id 0), the art will shut down gracefully with the predictable exit status of 130 (128 + the value of the signal). The NOvA script running art then can respond to exit status of 0 or 130 as a success, and all other values are failures.
Please let us know if this suffices.
#2 Updated by Christopher Backhouse over 4 years ago
I actually suggested this (as a joke) in the internal discussion.
The code for that is something simple like send_signal(get_pid(), SIGINT)?
for sure a global function, or function on some singleton that requests art to stop at the end of the current events would be cleaner.
Presumably art daq has a mechanism to achieve such a thing? Does that happen in their Source module?
#3 Updated by Kyle Knoepfel over 3 years ago
We would like to close this issue due to lack of feedback. Please notify us if you disagree.
#4 Updated by Kyle Knoepfel about 3 years ago
- Status changed from Feedback to Closed
Issue closed due to no feedback.