The Gaudi Framework
v41r0 (bdbe7744)
Toggle main menu visibility
Loading...
Searching...
No Matches
ControlFlowBranching+CrossBranchDataFlow.py
Go to the documentation of this file.
1
#!/usr/bin/env gaudirun.py
2
12
"""
13
Typically, an EVTREJECTED algorithm is used to "short-circuit" the execution flow within
14
the group of algorithms it belongs to. Within such early-terminated group, a false-negative
15
data dependency resolution can never occur since all downstream algorithms are skipped.
16
However, there might be other algorithms - outside of the early-terminated group - that depend
17
on data outputs of the EVTREJECTED algorithm. The test emulates this scenario.
18
"""
19
20
from
Configurables
import
(
21
AlgResourcePool,
22
AvalancheSchedulerSvc,
23
CPUCruncher,
24
CPUCrunchSvc,
25
Gaudi__Sequencer,
26
HiveSlimEventLoopMgr,
27
HiveWhiteBoard,
28
)
29
from
Gaudi.Configuration
import
*
30
31
# metaconfig
32
evtslots = 1
33
evtMax = 1
34
algosInFlight = 1
35
36
InertMessageSvc
(OutputLevel=INFO)
37
38
whiteboard =
HiveWhiteBoard
(
"EventDataSvc"
, EventSlots=evtslots, OutputLevel=INFO)
39
40
slimeventloopmgr =
HiveSlimEventLoopMgr
(
41
SchedulerName=
"AvalancheSchedulerSvc"
, OutputLevel=DEBUG
42
)
43
44
AvalancheSchedulerSvc
(ThreadPoolSize=algosInFlight, OutputLevel=DEBUG)
45
46
AlgResourcePool
(OutputLevel=DEBUG)
47
48
CPUCrunchSvc
(shortCalib=
True
)
49
50
# Assemble data flow graph
51
# algorithm that triggers an early exit from "Branch2"
52
a1 =
CPUCruncher
(
"AlgA"
, InvertDecision=
True
)
53
a1.outKeys = [
"/Event/A"
]
54
55
a2 =
CPUCruncher
(
"AlgB"
)
56
a2.inpKeys = [
"/Event/A"
]
57
58
a3 =
CPUCruncher
(
"AlgC"
)
59
a3.inpKeys = [
"/Event/A"
]
60
61
for
a
in
[a1, a2, a3]:
62
a.avgRuntime = 0.01
63
64
# Assemble control flow graph
65
branch1 = Gaudi__Sequencer(
"Branch1"
, ModeOR=
False
, ShortCircuit=
False
)
66
branch2 = Gaudi__Sequencer(
"Branch2"
, ModeOR=
False
, ShortCircuit=
True
, Sequential=
True
)
67
68
branch2.Members = [a1, a2]
69
branch1.Members = [branch2, a3]
70
71
ApplicationMgr
(
72
EvtMax=evtMax,
73
EvtSel=
"NONE"
,
74
ExtSvc=[whiteboard],
75
EventLoop=slimeventloopmgr,
76
TopAlg=[branch1],
77
MessageSvcType=
"InertMessageSvc"
,
78
OutputLevel=INFO,
79
)
AlgResourcePool
The AlgResourcePool is a concrete implementation of the IAlgResourcePool interface.
Definition
AlgResourcePool.h:35
ApplicationMgr
The Application Manager class.
Definition
ApplicationMgr.h:54
AvalancheSchedulerSvc
Definition
AvalancheSchedulerSvc.h:114
CPUCrunchSvc
Definition
CPUCrunchSvc.h:22
CPUCruncher
A class that implements a search for prime numbers.
Definition
CPUCruncher.h:30
HiveSlimEventLoopMgr
Definition
HiveSlimEventLoopMgr.h:31
HiveWhiteBoard
Data service base class.
Definition
HiveWhiteBoard.cpp:100
InertMessageSvc
Thread safe extension to the standard MessageSvc.
Definition
InertMessageSvc.h:32
Gaudi.Configuration
Definition
Configuration.py:1
GaudiHive
options
ControlFlowBranching+CrossBranchDataFlow.py
Generated on
for The Gaudi Framework by
1.17.0