| The Gaudi Framework v32r1 (f65d50dc)

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