Project

General

Profile

Feature #13852

Stop event loop dynamically end exit with status 0

Added by Pengfei Ding about 3 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
09/13/2016
Due date:
% Done:

0%

Estimated time:
Scope:
Internal
Experiment:
NOvA
SSI Package:
art
Duration:

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 about 3 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 about 3 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 1 year ago

We would like to close this issue due to lack of feedback. Please notify us if you disagree.

#4 Updated by Kyle Knoepfel over 1 year ago

  • Status changed from Feedback to Closed

Issue closed due to no feedback.



Also available in: Atom PDF