Skip to content
Snippets Groups Projects

[RTADPA BW Tests] Introducing an Hlt1-bandwidth test via Moore_in_Allen

Merged Luke Grazette requested to merge lugrazet-BW-initialhlt1test into master
4 files
+ 76
27
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -12,7 +12,8 @@
import GaudiPython as GP
from GaudiConf.reading import decoder, unpack_rawevent, hlt_decisions
from Configurables import (ApplicationMgr, LHCbApp, IODataManager,
EventSelector, createODIN, LHCb__UnpackRawEvent, HltDecReportsDecoder)
EventSelector, createODIN, LHCb__UnpackRawEvent,
HltDecReportsDecoder)
from GaudiConf import IOHelper
from PyConf.application import configured_ann_svc
import operator
@@ -143,8 +144,10 @@ def processing_events_per_line_and_stream(evt_max, lines, process):
# First three variables per stream/file, last four for lines
return events_file, raw_size_all, dst_size_all, event_stats, exclusive, raw, dst
def processing_events_per_line_and_stream_hlt1(lines):
inputfile = fname_helper.mdf_fname_for_reading(args.stream_config, args.stream)
inputfile = fname_helper.mdf_fname_for_reading(args.stream_config,
args.stream)
# Configure basic application with inputs
LHCbApp(DataType="Upgrade", Simulation=True)
@@ -154,7 +157,7 @@ def processing_events_per_line_and_stream_hlt1(lines):
# Decode Hlt DecReports
unpacker = LHCb__UnpackRawEvent(
"UnpackRawEvent",
RawBankLocations=["DAQ/RawBanks/HltDecReports"],
RawBankLocations=["DAQ/RawBanks/HltDecReports"],
BankTypes=["HltDecReports"])
decDec = HltDecReportsDecoder(
"HltDecReportsDecoder/Hlt1DecReportsDecoder",
@@ -171,12 +174,15 @@ def processing_events_per_line_and_stream_hlt1(lines):
gaudi.run(1)
mdf_size = os.stat(inputfile).st_size
if mdf_size<=0: assert RuntimeError(f"Size of {inputfile} is <=0")
if mdf_size <= 0: assert RuntimeError(f"Size of {inputfile} is <=0")
events_file = 0
raw_size_all = mdf_size
dst_size_all = -1 # Not a valid question to ask for hlt1
event_stats = {line: [] for line in [line + 'Decision' for line in list(lines)]}
dst_size_all = -1 # Not a valid question to ask for hlt1
event_stats = {
line: []
for line in [line + 'Decision' for line in list(lines)]
}
exclusive = {}
raw = {line: -1 for line in [line + 'Decision' for line in list(lines)]}
dst = {line: -1 for line in [line + 'Decision' for line in list(lines)]}
@@ -196,7 +202,8 @@ def processing_events_per_line_and_stream_hlt1(lines):
event_stats[line].append(events_file)
exclusive[events_file] += 1
gaudi.run(1)
if events_file==0: assert RuntimeError(f"No events found in {args.input}")
if events_file == 0:
assert RuntimeError(f"No events found in {args.input}")
for line, eventnumber_per_line in event_stats.items():
# ToDo: remove this assumption if possible
# Assume that the event_size is independent w.r.t. which line fired.
@@ -316,7 +323,7 @@ if __name__ == '__main__':
'--stream-config',
type=str,
help='Choose production, per-WG or streamless stream configuration',
choices=['streamless', 'production', 'wg'],
choices=['streamless', 'production', 'wg'],
required=True)
args = parser.parse_args()
@@ -348,13 +355,15 @@ if __name__ == '__main__':
# to read MDF output from Sprucing
algs = []
with open(fname_helper.stream_config_json_path(args.stream_config)) as f:
lines = json.load(f)[args.stream]
lines = json.load(f)[args.stream]
if not args.process == "hlt1":
unpack = unpack_rawevent(
bank_types=['ODIN', 'HltDecReports', 'DstData', 'HltRoutingBits'],
configurables=True)
hlt2 = [hlt_decisions(source="Hlt2", output_loc="/Event/Hlt2/DecReports")]
hlt2 = [
hlt_decisions(source="Hlt2", output_loc="/Event/Hlt2/DecReports")
]
if args.process == 'spruce':
spruce = [
hlt_decisions(
@@ -363,15 +372,17 @@ if __name__ == '__main__':
else:
spruce = []
decoder = decoder(input_process=args.process.capitalize())
algs = [unpack] + hlt2 + spruce + [decoder] + [createODIN(ODIN='myODIN')]
algs = [unpack] + hlt2 + spruce + [decoder
] + [createODIN(ODIN='myODIN')]
appMgr = ApplicationMgr(TopAlg=algs)
appMgr.ExtSvc += [
configured_ann_svc(json_file=fname_helper.tck(args.stream_config))
]
IOHelper("MDF").inputFiles(
[fname_helper.mdf_fname_for_reading(args.stream_config, args.stream)])
IOHelper("MDF").inputFiles([
fname_helper.mdf_fname_for_reading(args.stream_config, args.stream)
])
appMgr = GP.AppMgr()
evt = appMgr.evtsvc()
@@ -381,7 +392,8 @@ if __name__ == '__main__':
LHCbApp().EvtMax, lines, args.process)
else:
evts_all, rawbanks_all, dst_all, event_stats, exclusive, raw, dst = processing_events_per_line_and_stream_hlt1(lines)
evts_all, rawbanks_all, dst_all, event_stats, exclusive, raw, dst = processing_events_per_line_and_stream_hlt1(
lines)
rates_per_line(
event_stats, exclusive, raw, dst, input_config['input_rate'],
fname_helper.tmp_rate_table_per_line_path(args.stream_config,
Loading