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
34 nodes = (
'/Event',
'/Event/Rec',
'/Event/DAQ')
35 for l
in open(filename).readlines():
36 if l.find(
'StoreTracer') == 0:
37 if l.find(
'Executing Algorithm') != -1:
39 if alg
not in algs.keys() : algs[alg] = (order, set(),set())
42 elif l.find(
'Done with Algorithm') != -1:
44 elif l.find(
'[EventDataSvc]') != -1
and curr:
46 if obj
in nodes :
continue 47 if obj.find(
'/Event/') == 0 : obj = obj[7:]
48 obj = obj.replace(
'/',
'_')
49 if obj
not in objs : objs.append(obj)
51 if l.find(
'RETRIEVE') != -1:
52 if obj
not in talg[1] : talg[1].
add(obj)
53 elif l.find(
'REGOBJ') != -1:
54 if obj
not in talg[2] : talg[2].
add(obj)
55 if l.find(
"TimingAuditor") != -1:
58 if algo.endswith(
"|"):
60 algo = algo.rstrip(
"|")
61 if algo
in algs.keys():
62 timing[algo] = l.split()[index]
64 for name
in algs.keys():
65 if name.startswith(algo):
66 timing[name] = l.split()[index]
75 for alg
in timing.keys():
76 old_timing = float(timing[alg])
77 new_timing = old_timing*Scale;
79 timing[alg]=new_timing
81 for i, (alg,deps)
in enumerate(algs.items()):
82 if alg
in [
"PatPVOffline",
"PrsADCs"]:
continue 83 if deps[1]
or deps[2] :
85 inputs = [item
for item
in deps[1]
if item
not in (
"DAQ_ODIN",
"DAQ_RawEvent")
and item
not in deps[2]]
86 outputs = [item
for item
in deps[2]]
87 new_algo = CPUCruncher(alg,
88 avgRuntime=float(timing[alg]),
89 inpKeys=
map(
lambda s:
"/Event/"+s, inputs),
90 outKeys=
map(
lambda s:
"/Event/"+s, outputs),
100 all_outputs.add(item)
101 all_algos.append(new_algo)
102 all_algos_inputs.append(inputs)
104 new_algo = CPUCruncher(
"input",
107 outKeys=
map(
lambda s:
"/Event/"+s, [item
for item
in all_inputs.difference(all_outputs)]),
108 OutputLevel = WARNING
110 all_algos.append(new_algo)
111 all_algos_inputs.append([])
112 for algo
in all_algos:
113 algo.Cardinality=Cardinality
114 OutputLevel = WARNING
116 return all_algos,all_algos_inputs
121 ms.OutputLevel = Verbosity
125 whiteboard = HiveWhiteBoard(
"EventDataSvc",
126 EventSlots = NumberOfEventsInFlight)
128 slimeventloopmgr = HiveSlimEventLoopMgr(OutputLevel = INFO)
130 scheduler = ForwardSchedulerSvc(MaxEventsInFlight = NumberOfEventsInFlight,
131 MaxAlgosInFlight = NumberOfAlgosInFlight,
132 ThreadPoolSize = NumberOfThreads,
138 app.TopAlg = crunchers
140 app.EvtMax = NumberOfEvents
141 app.EventLoop = slimeventloopmgr
142 app.ExtSvc =[whiteboard]
143 app.MessageSvcType =
"InertMessageSvc" 144 app.OutputLevel = INFO
struct GAUDI_API map
Parametrisation class for map-like implementation.
The Application Manager class.
def load_brunel_scenario(filename)