The Gaudi Framework  v36r2 (27905625)
BrunelScenarioAvalancheScheduler.py
Go to the documentation of this file.
1 #!/usr/bin/env gaudirun.py
2 
12 
13 from Gaudi.Configuration import *
14 from Configurables import HiveWhiteBoard, HiveSlimEventLoopMgr, AvalancheSchedulerSvc, AlgResourcePool, CPUCrunchSvc
15 from GaudiTesting import SKIP_RETURN_CODE
16 
17 # convenience machinery for assembling custom graphs of algorithm precedence rules (w/ CPUCrunchers as algorithms)
18 try:
19  from GaudiHive import precedence
20 except ImportError:
21  # of versions of LCG/heptools do not provide the required package networkx
22  import sys
23  sys.exit(SKIP_RETURN_CODE) # consider the test skipped
24 
25 # metaconfig
26 evtslots = 1
27 evtMax = 1
28 cardinality = 1
29 algosInFlight = 4
30 algoAvgTime = 0.02
31 
32 InertMessageSvc(OutputLevel=INFO)
33 
34 whiteboard = HiveWhiteBoard(
35  "EventDataSvc", EventSlots=evtslots, OutputLevel=INFO, ForceLeaves=True)
36 
37 slimeventloopmgr = HiveSlimEventLoopMgr(
38  SchedulerName="AvalancheSchedulerSvc", OutputLevel=INFO)
39 
40 scheduler = AvalancheSchedulerSvc(
41  ThreadPoolSize=algosInFlight,
42  OutputLevel=DEBUG,
43  Optimizer="DRE",
44  PreemptiveBlockingTasks=False,
45  DumpIntraEventDynamics=False)
46 
47 AlgResourcePool(OutputLevel=DEBUG)
48 
49 CPUCrunchSvc(shortCalib=True)
50 
51 timeValue = precedence.UniformTimeValue(avgRuntime=algoAvgTime)
52 #timeValue = precedence.RealTimeValue(
53 # path="lhcb/reco/timing.Brunel.1kE.json", defaultTime=0.0)
54 ifIObound = precedence.UniformBooleanValue(False)
55 # 296 values, biased approximately as 90% to 10% - corresponds to the .GRAPHML scenario used below
56 # (295 precedence graph algorithms, plus one fake algorithm - FetchFromFile)
57 #ifIObound = precedence.RndBiasedBoolenValue(pattern = {True: 29, False: 267}, seed=1)
58 
59 sequencer = precedence.CruncherSequence(
60  timeValue,
61  ifIObound,
62  sleepFraction=0.0,
63  cfgPath="lhcb/reco/cf.Brunel.graphml",
64  dfgPath="lhcb/reco/df.Brunel.graphml",
65  topSequencer='BrunelSequencer').get()
66 
68  EvtMax=evtMax,
69  EvtSel='NONE',
70  ExtSvc=[whiteboard],
71  EventLoop=slimeventloopmgr,
72  TopAlg=[sequencer],
73  MessageSvcType="InertMessageSvc",
74  OutputLevel=INFO)
InertMessageSvc
Definition: InertMessageSvc.h:36
Gaudi::Functional::details::get
auto get(const Handle &handle, const Algo &, const EventContext &) -> decltype(details::deref(handle.get()))
Definition: FunctionalDetails.h:405
Gaudi.Configuration
Definition: Configuration.py:1
ApplicationMgr
Definition: ApplicationMgr.h:57