2 from Configurables
import GaudiExamplesCommonConf, CPUCruncher, HiveSlimEventLoopMgr, HiveWhiteBoard, ForwardSchedulerSvc
8 NUMBEROFEVENTSINFLIGHT = 7
9 NUMBEROFALGOSINFLIGHT = 11
15 NumberOfEvents = NUMBEROFEVENTS
16 NumberOfEventsInFlight = NUMBEROFEVENTSINFLIGHT
17 NumberOfAlgosInFlight = NUMBEROFALGOSINFLIGHT
18 NumberOfThreads = NUMBEROFTHREADS
19 Cardinality = CARDINALITY
33 nodes = (
'/Event',
'/Event/Rec',
'/Event/DAQ')
34 for l
in open(filename).readlines():
35 if l.find(
'StoreTracer') == 0:
36 if l.find(
'Executing Algorithm') != -1:
38 if alg
not in algs.keys():
39 algs[alg] = (order, set(), set())
42 elif l.find(
'Done with Algorithm') != -1:
44 elif l.find(
'[EventDataSvc]') != -1
and curr:
48 if obj.find(
'/Event/') == 0:
50 obj = obj.replace(
'/',
'_')
54 if l.find(
'RETRIEVE') != -1:
55 if obj
not in talg[1]:
57 elif l.find(
'REGOBJ') != -1:
58 if obj
not in talg[2]:
60 if l.find(
"TimingAuditor") != -1:
63 if algo.endswith(
"|"):
65 algo = algo.rstrip(
"|")
66 if algo
in algs.keys():
67 timing[algo] = l.split()[index]
69 for name
in algs.keys():
70 if name.startswith(algo):
71 timing[name] = l.split()[index]
80 for alg
in timing.keys():
81 old_timing = float(timing[alg])
82 new_timing = old_timing * Scale
84 timing[alg] = new_timing
86 for i, (alg, deps)
in enumerate(algs.items()):
87 if alg
in [
"PatPVOffline",
"PrsADCs"]:
89 if deps[1]
or deps[2]:
91 inputs = [item
for item
in deps[1]
if item
not in (
92 "DAQ_ODIN",
"DAQ_RawEvent")
and item
not in deps[2]]
93 outputs = [item
for item
in deps[2]]
94 new_algo = CPUCruncher(alg,
95 avgRuntime=float(timing[alg]),
97 lambda s:
"/Event/" + s, inputs),
99 lambda s:
"/Event/" + s, outputs),
109 all_outputs.add(item)
110 all_algos.append(new_algo)
111 all_algos_inputs.append(inputs)
113 new_algo = CPUCruncher(
"input",
117 lambda s:
"/Event/" + s, [item
for item
in all_inputs.difference(all_outputs)]),
120 all_algos.append(new_algo)
121 all_algos_inputs.append([])
122 for algo
in all_algos:
123 algo.Cardinality = Cardinality
124 OutputLevel = WARNING
126 return all_algos, all_algos_inputs
131 ms.OutputLevel = Verbosity
135 whiteboard = HiveWhiteBoard(
"EventDataSvc",
136 EventSlots=NumberOfEventsInFlight)
138 slimeventloopmgr = HiveSlimEventLoopMgr(OutputLevel=INFO)
140 scheduler = ForwardSchedulerSvc(MaxEventsInFlight=NumberOfEventsInFlight,
141 MaxAlgosInFlight=NumberOfAlgosInFlight,
142 ThreadPoolSize=NumberOfThreads,
148 app.TopAlg = crunchers
150 app.EvtMax = NumberOfEvents
151 app.EventLoop = slimeventloopmgr
152 app.ExtSvc = [whiteboard]
153 app.MessageSvcType =
"InertMessageSvc" 154 app.OutputLevel = INFO
struct GAUDI_API map
Parametrisation class for map-like implementation.
The Application Manager class.
def load_brunel_scenario(filename)