The Gaudi Framework  v38r3 (c3fc9673)
event_timeout_check Namespace Reference

Functions

list[Configurable] add_event_timeout (list[Configurable] conf, int timeout_seconds)
 
def config ()
 

Variables

 algorithms
 
 SleepTime
 
 app
 
list EvtSel = [C.Gaudi.Sequencer("MainSequence", Members=algorithms)]
 

Function Documentation

◆ add_event_timeout()

list[Configurable] event_timeout_check.add_event_timeout ( list[Configurable]  conf,
int   timeout_seconds 
)
Take a configuration and adds a check on events reaching a timeout.

Definition at line 47 of file event_timeout_check.py.

48  conf: list[Configurable], timeout_seconds: int
49 ) -> list[Configurable]:
50  """
51  Take a configuration and adds a check on events reaching a timeout.
52  """
53  # find the ApplicationMgr as we have to tweak its configuration
54  app = next(c for c in conf if c.name == "ApplicationMgr")
55  # configure a Gaudi::EventWatchdogAlg
56  watchdog = C.Gaudi.EventWatchdogAlg(
57  EventTimeout=timeout_seconds, # sleep for this number of seconds
58  StackTrace=True, # print a stack trace when we wake up
59  AbortOnTimeout=True, # kill the process on timeout
60  )
61  # wrap original list of algorithms into a sequence to ensure the watchdog
62  # is executed before everything else
63  wrapping_seq = C.Gaudi.Sequencer(
64  "SequenceWithTimeout", Sequential=True, Members=[watchdog] + list(app.TopAlg)
65  )
66  # reset the main list of algorithms
67  app.TopAlg = [wrapping_seq]
68  # return the tweaked configuration
69  return conf + [watchdog, wrapping_seq]
70 
71 

◆ config()

def event_timeout_check.config ( )

Definition at line 72 of file event_timeout_check.py.

72 def config():
73  # get the normal job configuration
74  conf = base_config()
75  # make sure we stop if an event takes more than 2s
76  conf = add_event_timeout(conf, 2)
77  return conf

Variable Documentation

◆ algorithms

event_timeout_check.algorithms

Definition at line 40 of file event_timeout_check.py.

◆ app

event_timeout_check.app

Definition at line 41 of file event_timeout_check.py.

◆ EvtSel

list event_timeout_check.EvtSel = [C.Gaudi.Sequencer("MainSequence", Members=algorithms)]

Definition at line 42 of file event_timeout_check.py.

◆ SleepTime

event_timeout_check.SleepTime

Definition at line 40 of file event_timeout_check.py.

event_timeout_check.config
def config()
Definition: event_timeout_check.py:72
event_timeout_check.add_event_timeout
list[Configurable] add_event_timeout(list[Configurable] conf, int timeout_seconds)
Definition: event_timeout_check.py:47