-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[12_4_X] Use "best matching" EDAlias in module dependence checks when placing ConditionalTask modules in Path #39530
Closed
makortel
wants to merge
1
commit into
cms-sw:CMSSW_12_4_X
from
makortel:fixSwitchProducerEDAliasConditionalTask_124x
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
86 changes: 86 additions & 0 deletions
86
FWCore/Integration/test/testSwitchProducerConditionalTaskEDAliasWildcard_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,86 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
import sys | ||
import argparse | ||
|
||
parser = argparse.ArgumentParser(prog=sys.argv[0], description="Test SwitchProducer, that has an EDAlias with '*' wildcard, in a ConditionalTask") | ||
|
||
parser.add_argument("--disableTest2", help="Disable 'test2' case of the SwitchProducerTest", action="store_true") | ||
parser.add_argument("--wildcardOnOtherModule", help="Use the wildcard for alias from another module", action="store_true") | ||
|
||
argv = sys.argv[:] | ||
if '--' in argv: | ||
argv.remove("--") | ||
args, unknown = parser.parse_known_args(argv) | ||
|
||
enableTest2 = not args.disableTest2 | ||
class SwitchProducerTest(cms.SwitchProducer): | ||
def __init__(self, **kargs): | ||
super(SwitchProducerTest,self).__init__( | ||
dict( | ||
test1 = lambda accelerators: (True, -10), | ||
test2 = lambda accelerators: (enableTest2, -9) | ||
), **kargs) | ||
|
||
process = cms.Process("PROD1") | ||
|
||
process.source = cms.Source("EmptySource") | ||
|
||
process.maxEvents.input = 3 | ||
|
||
process.intProducer1 = cms.EDProducer( | ||
"ManyIntProducer", | ||
ivalue = cms.int32(1), | ||
values = cms.VPSet( | ||
) | ||
) | ||
process.intProducer2 = cms.EDProducer( | ||
"ManyIntProducer", | ||
ivalue = cms.int32(11), | ||
values = cms.VPSet( | ||
cms.PSet(instance=cms.string("bar"), value=cms.int32(12)) | ||
) | ||
) | ||
process.intProducer3 = cms.EDProducer( | ||
"ManyIntProducer", | ||
ivalue = cms.int32(21) | ||
) | ||
if args.wildcardOnOtherModule: | ||
process.intProducer1.values.append(cms.PSet(instance=cms.string("bar"), value=cms.int32(2))) | ||
process.intProducer2.values = [] | ||
|
||
process.intProducer4 = cms.EDProducer( | ||
"ManyIntProducer", | ||
ivalue = cms.int32(31), | ||
values = cms.VPSet( | ||
cms.PSet(instance=cms.string("foo"), value=cms.int32(32)), | ||
cms.PSet(instance=cms.string("bar"), value=cms.int32(33)), | ||
cms.PSet(instance=cms.string("xyzzy"), value=cms.int32(34)), | ||
) | ||
) | ||
|
||
process.intProducer = SwitchProducerTest( | ||
test1 = cms.EDAlias( | ||
intProducer4 = cms.EDAlias.allProducts() | ||
), | ||
test2 = cms.EDAlias() | ||
) | ||
allMatchName = "intProducer1" | ||
otherName ="intProducer2" | ||
if args.wildcardOnOtherModule: | ||
(allMatchName, otherName) = (otherName, allMatchName) | ||
setattr(process.intProducer.test2, allMatchName, cms.EDAlias.allProducts()) | ||
setattr(process.intProducer.test2, otherName, cms.VPSet( | ||
cms.PSet(type = cms.string("*"), fromProductInstance = cms.string(""), toProductInstance = cms.string("foo")), | ||
cms.PSet(type = cms.string("*"), fromProductInstance = cms.string("bar"), toProductInstance = cms.string("*")) | ||
)) | ||
process.intProducer.test2.intProducer3 = cms.VPSet( | ||
cms.PSet(type = cms.string("edmtestIntProduct"), toProductInstance = cms.string("xyzzy")) | ||
) | ||
|
||
process.intConsumer = cms.EDAnalyzer("edmtest::GenericIntsAnalyzer", srcEvent = cms.untracked.VInputTag("intProducer")) | ||
process.intConsumer2 = cms.EDAnalyzer("edmtest::GenericIntsAnalyzer", srcEvent = cms.untracked.VInputTag("intProducer", "intProducer2", "intProducer3")) | ||
|
||
process.ct = cms.ConditionalTask(process.intProducer1, process.intProducer2, process.intProducer3, process.intProducer4, process.intProducer) | ||
|
||
process.p1 = cms.Path(process.intConsumer, process.ct) | ||
process.p2 = cms.Path(process.intConsumer2, process.ct) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two are
std::unordered_multimap
in master and 12_5_X