Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v36r16 (ea80daf8)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
SingleBlockingTaskAvalancheScheduler.py
Go to the documentation of this file.
1 #!/usr/bin/env gaudirun.py
2 
12 """
13 The simplest possible configuration for preemptive scheduling of single blocking algorithm.
14 """
15 
16 from Configurables import (
17  AvalancheSchedulerSvc,
18  CPUCruncher,
19  CPUCrunchSvc,
20  HiveSlimEventLoopMgr,
21  HiveWhiteBoard,
22 )
23 from Gaudi.Configuration import *
24 
25 # metaconfig
26 evtMax = 7
27 evtslots = 3
28 algosInFlight = 0
29 blockingAlgosInFlight = 3
30 
31 CPUCrunchSvc(shortCalib=True)
32 
33 whiteboard = HiveWhiteBoard("EventDataSvc", EventSlots=evtslots, OutputLevel=INFO)
34 
35 slimeventloopmgr = HiveSlimEventLoopMgr(
36  SchedulerName="AvalancheSchedulerSvc", OutputLevel=INFO
37 )
38 
39 AvalancheSchedulerSvc(
40  ThreadPoolSize=algosInFlight,
41  PreemptiveBlockingTasks=True,
42  MaxBlockingAlgosInFlight=blockingAlgosInFlight,
43  OutputLevel=VERBOSE,
44 )
45 
46 blockingAlg = CPUCruncher(
47  name="BlockingAlg",
48  avgRuntime=2.0,
49  Cardinality=3,
50  Blocking=True, # tag algorithm as blocking
51  SleepFraction=0.7, # simulate blocking nature
52  OutputLevel=DEBUG,
53 )
54 
56  EvtMax=evtMax,
57  EvtSel="NONE",
58  ExtSvc=[whiteboard],
59  EventLoop=slimeventloopmgr,
60  TopAlg=[blockingAlg],
61  MessageSvcType="InertMessageSvc",
62  OutputLevel=INFO,
63 )
Gaudi.Configuration
Definition: Configuration.py:1
ApplicationMgr
Definition: ApplicationMgr.h:57