| The Gaudi Framework v29r1 (5cd95fa2)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

ControlFlowBranching+CrossBranchDataFlow.py
Go to the documentation of this file.
1 #!/usr/bin/env gaudirun.py
2
3 """
4 Typically, an EVTREJECTED algorithm is used to "short-circuit" the execution flow within
5 the group of algorithms it belongs to. Within such early-terminated group, a false-negative
6 data dependency resolution can never occur since all downstream algorithms are skipped.
7 However, there might be other algorithms - outside of the early-terminated group - that depend
8 on data outputs of the EVTREJECTED algorithm. The test emulates this scenario.
9 """
10
11 from Gaudi.Configuration import *
12 from Configurables import HiveWhiteBoard, HiveSlimEventLoopMgr, AvalancheSchedulerSvc, AlgResourcePool
13 from Configurables import GaudiSequencer, CPUCruncher
14
15 # metaconfig
16 evtslots = 1
17 evtMax = 1
18 algosInFlight = 1
19
20
21 InertMessageSvc(OutputLevel=INFO)
22
23 whiteboard = HiveWhiteBoard("EventDataSvc",
24 EventSlots=evtslots,
25 OutputLevel=INFO)
26
27 slimeventloopmgr = HiveSlimEventLoopMgr(SchedulerName="AvalancheSchedulerSvc",
28 OutputLevel=DEBUG)
29
30 AvalancheSchedulerSvc(ThreadPoolSize=algosInFlight,
31 OutputLevel=DEBUG)
32
33 AlgResourcePool(OutputLevel=DEBUG)
34
35 # Assemble data flow graph
36 # algorithm that triggers an early exit from "Branch2"
37 a1 = CPUCruncher("AlgA", InvertDecision=True)
38 a1.outKeys = ['/Event/A']
39
40 a2 = CPUCruncher("AlgB")
41 a2.inpKeys = ['/Event/A']
42
43 a3 = CPUCruncher("AlgC")
44 a3.inpKeys = ['/Event/A']
45
46 for a in [a1, a2, a3]:
47 a.shortCalib = True
48 a.avgRuntime = .01
49
50 # Assemble control flow graph
51 branch1 = GaudiSequencer("Branch1", ModeOR=False, ShortCircuit=False)
52 branch2 = GaudiSequencer("Branch2", ModeOR=False,
53 ShortCircuit=True, Sequential=True)
54
55 branch2.Members = [a1, a2]
56 branch1.Members = [branch2, a3]
57
58
59 ApplicationMgr(EvtMax=evtMax,
60 EvtSel='NONE',
61 ExtSvc=[whiteboard],
62 EventLoop=slimeventloopmgr,
63 TopAlg=[branch1],
64 MessageSvcType="InertMessageSvc",
65 OutputLevel=INFO)
InertMessageSvc
Thread safe extension to the standard MessageSvc.
Definition: InertMessageSvc.h:26
Gaudi.Configuration
Definition: Configuration.py:1
ApplicationMgr
The Application Manager class.
Definition: ApplicationMgr.h:47