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