The Gaudi Framework  master (b9786168)
Loading...
Searching...
No Matches
AvalancheSchedulerErrorTest.py
Go to the documentation of this file.
1#!/usr/bin/env gaudirun.py
2
12"""
13Test the correct handling on errors during the event processing:
14- The CPUCruncher is configured to return an ERROR on a fraction of the events
15- The EventLoopMgr is configured to continue with the next event on ERROR
16"""
17
18from Configurables import (
19 AlgResourcePool,
20 ApplicationMgr,
21 AvalancheSchedulerSvc,
22 CPUCruncher,
23 CPUCrunchSvc,
24 HiveSlimEventLoopMgr,
25 HiveWhiteBoard,
26 InertMessageSvc,
27)
28from Gaudi.Configuration import *
29
30evtslots = 8
31evtMax = 50
32cardinality = 10
33threads = 10
34
35whiteboard = HiveWhiteBoard("EventDataSvc", EventSlots=evtslots)
36
37slimeventloopmgr = HiveSlimEventLoopMgr(
38 SchedulerName="AvalancheSchedulerSvc", OutputLevel=DEBUG, AbortOnFailure=False
39)
40
41scheduler = AvalancheSchedulerSvc(ThreadPoolSize=threads, OutputLevel=DEBUG)
42
43AlgResourcePool(OutputLevel=DEBUG)
44CPUCrunchSvc(shortCalib=True)
45
46#
47# - A3 returns an ERROR once in a while
48# - A1-A2-A4 execute normally and then a stall is detected
49#
50# A1
51# / \
52# A2 A3
53# | |
54# A4 A5
55#
56a1 = CPUCruncher("A1")
57a1.outKeys = ["/Event/a1"]
58
59a2 = CPUCruncher("A2")
60a2.inpKeys = ["/Event/a1"]
61a2.outKeys = ["/Event/a2"]
62
63a3 = CPUCruncher("A3")
64a3.inpKeys = ["/Event/a1"]
65a3.outKeys = ["/Event/a3"]
66a3.FailNEvents = 7 # produce ERROR every Nth event
67
68a4 = CPUCruncher("A4")
69a4.inpKeys = ["/Event/a2"]
70a4.outKeys = ["/Event/a4"]
71
72a5 = CPUCruncher("A5")
73a5.inpKeys = ["/Event/a3"]
74a5.outKeys = ["/Event/a5"]
75
76for algo in [a1, a2, a3, a4, a5]:
77 algo.Cardinality = cardinality
78 algo.avgRuntime = 0.1
79
80msgSvc = InertMessageSvc("MessageSvc", Format="% F%30W%S%4W%e%s%7W%R%T %0W%M")
81ApplicationMgr().SvcMapping.append(msgSvc)
82
84 EvtMax=evtMax,
85 EvtSel="NONE",
86 ExtSvc=[whiteboard],
87 EventLoop=slimeventloopmgr,
88 TopAlg=[a1, a2, a3, a4, a5],
89 MessageSvcType="InertMessageSvc",
90)
The AlgResourcePool is a concrete implementation of the IAlgResourcePool interface.
The Application Manager class.
A class that implements a search for prime numbers.
Definition CPUCruncher.h:30
Data service base class.
Thread safe extension to the standard MessageSvc.