Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 
55  EvtMax=evtMax,
56  EvtSel='NONE',
57  ExtSvc=[whiteboard],
58  EventLoop=slimeventloopmgr,
59  TopAlg=[branch, a3],
60  MessageSvcType="InertMessageSvc",
61  OutputLevel=INFO)
A class that implements a search for prime numbers.
Definition: CPUCruncher.h:19
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.