-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Print the labels of ConditionalTask modules that are not consumed in …
…any of the associated Paths The original goal was to delete such modules from the job (similarly to non-consumed unscheduled modules), but that turned out to be complicated (as there could be modules that should be treated like this that _are_ consumed by some other module). Printing out the labels should suffice the remaining HLT needs for ConditionalTask.
- Loading branch information
Showing
6 changed files
with
203 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
FWCore/Framework/test/test_conditionaltasks_nonconsumed.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
function die { echo Failure $1: status $2 ; exit $2 ; } | ||
|
||
CONFIG=${LOCALTOP}/src/FWCore/Framework/test/test_conditionaltasks_nonconsumed_cfg.py | ||
OUTPUT=conditionaltasks_nonconsumed.log | ||
REFERENCE=${LOCALTOP}/src/FWCore/Framework/test/unit_test_outputs/$OUTPUT | ||
|
||
function run { | ||
cmsRun $CONFIG $@ | ||
tail -n +2 conditionaltasks_nonconsumed.log | diff - $REFERENCE || die "cmsRun $CONFIG $@ provides unexpected log" | ||
} | ||
|
||
run | ||
run --filterSucceeds | ||
run --testView |
104 changes: 104 additions & 0 deletions
104
FWCore/Framework/test/test_conditionaltasks_nonconsumed_cfg.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
import argparse | ||
import sys | ||
|
||
parser = argparse.ArgumentParser(prog=sys.argv[0], description='Test ConditionalTasks.') | ||
|
||
parser.add_argument("--filterSucceeds", help="Have filter succeed", action="store_true") | ||
parser.add_argument("--testView", help="Get data via a view", action="store_true") | ||
|
||
args = parser.parse_args() | ||
|
||
process = cms.Process("Test") | ||
|
||
process.source = cms.Source("EmptySource") | ||
|
||
# ensure the printout is done only once | ||
process.maxEvents.input = 4 | ||
process.options.numberOfThreads = 4 | ||
|
||
process.MessageLogger.files.conditionaltasks_nonconsumed = dict() | ||
process.MessageLogger.files.conditionaltasks_nonconsumed.default = dict(limit=0) | ||
process.MessageLogger.files.conditionaltasks_nonconsumed.NonConsumedConditionalModules = dict(limit=100) | ||
|
||
process.a = cms.EDProducer("IntProducer", ivalue = cms.int32(1)) | ||
process.b = cms.EDProducer("AddIntsProducer", labels = cms.VInputTag(cms.InputTag("a"))) | ||
|
||
process.f1 = cms.EDFilter("IntProductFilter", label = cms.InputTag("b")) | ||
|
||
process.c = cms.EDProducer("IntProducer", ivalue = cms.int32(2)) | ||
process.d = cms.EDProducer("AddIntsProducer", labels = cms.VInputTag(cms.InputTag("c"))) | ||
process.e = cms.EDProducer("AddIntsProducer", labels = cms.VInputTag(cms.InputTag("d"))) | ||
|
||
process.nonconsumed = process.a.clone() | ||
process.nonconsumed2 = process.b.clone( | ||
labels = ["nonconsumed"] | ||
) | ||
process.nonconsumedConditionalTask = cms.ConditionalTask( | ||
process.nonconsumed, | ||
process.nonconsumed2, | ||
) | ||
|
||
process.consumedInOnePath = process.a.clone() | ||
process.nonconsumedConditionalTask2 = cms.ConditionalTask( | ||
process.nonconsumed, | ||
process.consumedInOnePath | ||
) | ||
|
||
process.explicitlyInDifferentPath = process.a.clone() | ||
process.consumedInUnrelatedPath = process.a.clone() | ||
process.nonconsumedConditionalTask3 = cms.ConditionalTask( | ||
process.nonconsumed, | ||
process.explicitlyInDifferentPath, | ||
process.consumedInUnrelatedPath | ||
) | ||
process.nonconsumedTask3 = cms.Task( | ||
process.consumedInUnrelatedPath | ||
) | ||
|
||
process.prodOnPath = cms.EDProducer("AddIntsProducer", labels = cms.VInputTag(cms.InputTag("d"), cms.InputTag("e"))) | ||
process.prodOnPath2 = process.prodOnPath.clone( | ||
labels = ["consumedInOnePath"] | ||
) | ||
process.prodOnPath3 = process.prodOnPath.clone( | ||
labels = ["consumedInUnrelatedPath"] | ||
) | ||
|
||
if args.filterSucceeds: | ||
threshold = 1 | ||
else: | ||
threshold = 3 | ||
|
||
process.f2 = cms.EDFilter("IntProductFilter", label = cms.InputTag("e"), threshold = cms.int32(threshold)) | ||
|
||
if args.testView: | ||
process.f3 = cms.EDAnalyzer("SimpleViewAnalyzer", | ||
label = cms.untracked.InputTag("f"), | ||
sizeMustMatch = cms.untracked.uint32(10), | ||
checkSize = cms.untracked.bool(False) | ||
) | ||
process.f = cms.EDProducer("OVSimpleProducer", size = cms.int32(10)) | ||
producttype = "edmtestSimplesOwned" | ||
else: | ||
process.f= cms.EDProducer("IntProducer", ivalue = cms.int32(3)) | ||
process.f3 = cms.EDFilter("IntProductFilter", label = cms.InputTag("f")) | ||
producttype = "edmtestIntProduct" | ||
|
||
process.p = cms.Path(process.f1+process.prodOnPath+process.f2+process.f3, cms.ConditionalTask(process.a, process.b, process.c, process.d, process.e, process.f, process.nonconsumedConditionalTask, process.nonconsumedConditionalTask2)) | ||
|
||
process.p2 = cms.Path(process.prodOnPath2, process.nonconsumedConditionalTask2, process.nonconsumedConditionalTask3) | ||
|
||
process.p3 = cms.Path(process.explicitlyInDifferentPath) | ||
|
||
process.p4 = cms.Path(process.prodOnPath3, process.nonconsumedTask3) | ||
|
||
process.tst = cms.EDAnalyzer("IntTestAnalyzer", moduleLabel = cms.untracked.InputTag("f"), valueMustMatch = cms.untracked.int32(3), | ||
valueMustBeMissing = cms.untracked.bool(not args.filterSucceeds)) | ||
|
||
process.nonconsumedConsumer = cms.EDProducer("AddIntsProducer", labels = cms.VInputTag(cms.InputTag("nonconsumed"))) | ||
|
||
process.endp = cms.EndPath(process.tst+process.nonconsumedConsumer) | ||
|
||
#process.add_(cms.Service("Tracer")) | ||
#process.options.wantSummary=True |
9 changes: 9 additions & 0 deletions
9
FWCore/Framework/test/unit_test_outputs/conditionaltasks_nonconsumed.log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
The following modules were part of some ConditionalTask, but were not | ||
consumed by any other module in any of the Paths the ConditionalTask | ||
was associated with. Perhaps they should be either removed from the | ||
job, or moved to a Task to make it explicit they are unscheduled. | ||
consumedInUnrelatedPath | ||
nonconsumed | ||
nonconsumed2 | ||
|
||
%MSG |