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