The Gaudi Framework  v36r1 (3e2fb5a8)
detectSimpleStall.py
Go to the documentation of this file.
1 #!/usr/bin/env gaudirun.py
2 
12 """
13 The options file models an intra-event stall in algorithm scheduling.
14 An early exit from a group of algorithms called 'EarlyExitBranch' is performed due to
15 an inverted CF decision sot that A2 is not run. This results in an unmet DF dependency
16 for a downstream algorithm A3, leading to the stall.
17 """
18 
19 from Gaudi.Configuration import *
20 from Configurables import (HiveWhiteBoard, HiveSlimEventLoopMgr, CPUCrunchSvc,
21  AvalancheSchedulerSvc, AlgResourcePool, CPUCruncher)
22 
23 evtslots = 1
24 evtMax = 1
25 cardinality = 1
26 threads = 1
27 
28 whiteboard = HiveWhiteBoard("EventDataSvc", EventSlots=evtslots)
29 
30 slimeventloopmgr = HiveSlimEventLoopMgr(
31  SchedulerName="AvalancheSchedulerSvc", OutputLevel=DEBUG)
32 
33 scheduler = AvalancheSchedulerSvc(ThreadPoolSize=threads, OutputLevel=VERBOSE)
34 
35 AlgResourcePool(OutputLevel=DEBUG)
36 
37 CPUCrunchSvc(shortCalib=True)
38 
39 # Set up of CPU crunchers -------------------------------------------------------
40 
41 a1 = CPUCruncher("A1")
42 # to skip algorithm 'A2', force early exit from the branch
43 # This leads to data flow stall
44 a1.InvertDecision = True
45 
46 # this algorithm is not run due to early exit from the group it belongs to
47 a2 = CPUCruncher("A2")
48 a2.outKeys = ['/Event/a2']
49 
50 a3 = CPUCruncher("A3")
51 a3.inpKeys = ['/Event/a2']
52 
53 # Assemble control flow graph
54 branch = GaudiSequencer(
55  "EarlyExitBranch", ModeOR=False, ShortCircuit=True, Sequential=True)
56 branch.Members = [a1, a2]
57 
58 for algo in [a1, a2, a3]:
59  algo.Cardinality = cardinality
60  algo.avgRuntime = .1
61 
62 # Application Manager ----------------------------------------------------------
63 
65  EvtMax=evtMax,
66  EvtSel='NONE',
67  ExtSvc=[whiteboard],
68  EventLoop=slimeventloopmgr,
69  TopAlg=[branch, a3],
70  MessageSvcType="InertMessageSvc",
71  OutputLevel=INFO)
Gaudi.Configuration
Definition: Configuration.py:1
GaudiSequencer
Definition: GaudiSequencer.h:38
ApplicationMgr
Definition: ApplicationMgr.h:57