The Gaudi Framework  v36r1 (3e2fb5a8)
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 Gaudi.Configuration import *
17 from Configurables import HiveWhiteBoard, HiveSlimEventLoopMgr, AvalancheSchedulerSvc, CPUCruncher, CPUCrunchSvc
18 
19 # metaconfig
20 evtMax = 7
21 evtslots = 3
22 algosInFlight = 0
23 blockingAlgosInFlight = 3
24 
25 CPUCrunchSvc(shortCalib=True)
26 
27 whiteboard = HiveWhiteBoard(
28  "EventDataSvc", EventSlots=evtslots, OutputLevel=INFO)
29 
30 slimeventloopmgr = HiveSlimEventLoopMgr(
31  SchedulerName="AvalancheSchedulerSvc", OutputLevel=INFO)
32 
33 AvalancheSchedulerSvc(
34  ThreadPoolSize=algosInFlight,
35  PreemptiveBlockingTasks=True,
36  MaxBlockingAlgosInFlight=blockingAlgosInFlight,
37  OutputLevel=VERBOSE)
38 
39 blockingAlg = CPUCruncher(
40  name="BlockingAlg",
41  avgRuntime=2.,
42  Cardinality=3,
43  Blocking=True, # tag algorithm as blocking
44  SleepFraction=0.7, # simulate blocking nature
45  OutputLevel=DEBUG)
46 
48  EvtMax=evtMax,
49  EvtSel='NONE',
50  ExtSvc=[whiteboard],
51  EventLoop=slimeventloopmgr,
52  TopAlg=[blockingAlg],
53  MessageSvcType="InertMessageSvc",
54  OutputLevel=INFO)
Gaudi.Configuration
Definition: Configuration.py:1
ApplicationMgr
Definition: ApplicationMgr.h:57