From 2bd47e775acc346ca4670ca8f68f69f13e47a414 Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Fri, 12 Jun 2015 12:02:08 +0200 Subject: [PATCH 1/3] hltDumpStream: add support for configuration fragments --- HLTrigger/Configuration/scripts/hltDumpStream | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/HLTrigger/Configuration/scripts/hltDumpStream b/HLTrigger/Configuration/scripts/hltDumpStream index d43404cc9fa60..d4e524a573aed 100755 --- a/HLTrigger/Configuration/scripts/hltDumpStream +++ b/HLTrigger/Configuration/scripts/hltDumpStream @@ -15,7 +15,14 @@ else: config = open(configname) exec config in globals(), hlt.__dict__ config.close() -process = hlt.process + +if 'process' in hlt.__dict__: + process = hlt.process +elif 'fragment' in hlt.__dict__: + process = hlt.fragment +else: + sys.stderr.write("Error: the input is not a valid HLT configuration") + sys.exit(1) # read global prescale service prescale = dict() From bd0de854aa19b83e0982a5a2652bce240bddb835 Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Fri, 12 Jun 2015 12:27:59 +0200 Subject: [PATCH 2/3] hltDumpStream: do not crash if a path listed in a dataset is not in the configuration --- HLTrigger/Configuration/scripts/hltDumpStream | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/HLTrigger/Configuration/scripts/hltDumpStream b/HLTrigger/Configuration/scripts/hltDumpStream index d4e524a573aed..452f2a8b25e62 100755 --- a/HLTrigger/Configuration/scripts/hltDumpStream +++ b/HLTrigger/Configuration/scripts/hltDumpStream @@ -214,8 +214,10 @@ def getPrescalesDescription(name, out, end): # format the information about a path associated to a specific endpath def dumpPath(name, out, end): + if name not in process.paths: + return ' %-*s*** missing ***' % (length, name) + path = process.paths[name] - length = max(len(p) for p in process.paths) + 4 # look for prescales preDesc = getPrescalesDescription(name, out, end) @@ -273,7 +275,7 @@ def dumpStream(stream): missing = assigned - allpaths if missing: - print ' *** missing paths in the output module ***' + print ' *** paths missing from the output module ***' for path in sorted(missing): print dumpPath(path, out, end) @@ -294,5 +296,11 @@ def dumpOutput(stream): streams = process.streams._Parameterizable__parameterNames streams.sort() +# figure the longest path name +length = 32 +length_p = max(len(p) for p in process.paths) +length_d = max(len(p) for d in process.datasets.__dict__ if not d.startswith('_') for p in process.datasets.__dict__[d]) +length = max(length_p, length_d, length) + 4 + for stream in streams: dumpStream(stream) From dce3f6c98dd9a15a8a95f9dc72ab5042943b38b6 Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Fri, 12 Jun 2015 12:33:19 +0200 Subject: [PATCH 3/3] hltDumpStream: reorder error messages --- HLTrigger/Configuration/scripts/hltDumpStream | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/HLTrigger/Configuration/scripts/hltDumpStream b/HLTrigger/Configuration/scripts/hltDumpStream index 452f2a8b25e62..513a2f7efd24f 100755 --- a/HLTrigger/Configuration/scripts/hltDumpStream +++ b/HLTrigger/Configuration/scripts/hltDumpStream @@ -240,8 +240,6 @@ def getEndPath(output): if searchOut.found: out = o.label_() break - else: - print " *** corresponding EndPath not found ***" return out @@ -273,11 +271,14 @@ def dumpStream(stream): for path in sorted(unassigned): print dumpPath(path, out, end) - missing = assigned - allpaths - if missing: - print ' *** paths missing from the output module ***' - for path in sorted(missing): - print dumpPath(path, out, end) + if not end: + print ' *** corresponding EndPath not found ***' + else: + missing = assigned - allpaths + if missing: + print ' *** paths missing from the EndPath\'s output module ***' + for path in sorted(missing): + print dumpPath(path, out, end) def dumpOutput(stream):