-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
improve the SwitchProducer error message to suggest a solution #31230
Comments
assign core |
New categories assigned: core @Dr15Jones,@smuzaffar,@makortel you have been requested to review this Pull request/Issue and eventually sign? Thanks |
A new Issue was created by @fwyzard Andrea Bocci. @Dr15Jones, @dpiparo, @silviodonato, @smuzaffar, @makortel, @qliphy can you please review it and eventually sign/assign? Thanks. cms-bot commands are listed here |
Given that the same outcome can be achieved by EDAliases (whose construction can be tedious as written in the description), such a flag could indeed make sense. I can't quickly think of any concerns on it. Perhaps something like foo = cms.SwitchProcucerCUDA(
cpu = cms.EDProducer("FooProducer", ...),
cuda = cms.EDProducer("FooProducerCUDA", ...),
restrictProductsToCommonSubset_ = cms.bool(True)
) ? I'd use an underscore in the parameter name to signify that it is not a case of the switch, and I think it should be tracked because it affects which products exist. |
On a deeper look that would require constructing the case-producers before their Other hurdle is that the current code expects normal EDAliases to be set up first before setting up the aliases within Thinking out loud, a possible simple way to work around a mismatch in the products without requiring a full blown EDAlias setup would be to add a parameter to ignore given branches, e.g. something along foo = cms.SwitchProcucerCUDA(
cpu = cms.EDProducer("FooProducer", ...),
cuda = cms.EDProducer("FooProducerCUDA", ...),
ignoreProducts_ = vms.VPSet(
PSet(type = cms.string("<friendly class name>")),
PSet(type = cms.string("<friendly class name>"), productInstance = cms.string("<instance name>")
)
) (with a corresponding improvement in the error message) |
The hardest part is to figure out all the branch names that need to be aliased and/or ignored. So, if the error message in case of a mismatch could give the full list of branches from both sides of the switch, that would already help a lot. Rather than giving a list of branches to ignore, I think it would make more sense to give a list of branches to use. |
That is certainly doable as well. I also began to wonder if a generic mechanism to keep/ignore (similar to OutputModule's |
The exception message is improved in #31414. I'm fine with keeping this issue open until a more automated solution is found. |
To think out loud, reversing the logic in #31230 (comment) would lead to something along foo = cms.SwitchProcucerCUDA(
cpu = cms.EDProducer("FooProducer", ...),
cuda = cms.EDProducer("FooProducerCUDA", ...),
restrictToProducts_ = vms.VPSet(
PSet(type = cms.string("<friendly class name>")),
PSet(type = cms.string("<friendly class name>"), productInstance = cms.string("<instance name>")
)
) |
Some parts of the annoyance (differences in transient products) were reduced with #40104. Given that |
+core |
@cmsbuild, please close |
cms-bot internal usage |
This issue is fully signed and ready to be closed. |
Currently, if two branches in a
SwitchProducer
produce a different set of products, the error message is of limited usefulness.For example:
or the other way around
Assuming that the extra product is not needed, in order to fix the problem one needs to find the list of all other products - including their type - and populate an
EDAlias
declaration.The error message could be more helpful and provide this list.
Even better, the
SwitchProducer
could use a flag to automatically restrict the products to the common subset.The text was updated successfully, but these errors were encountered: