-
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
Process dump python psets first [or how to modify outputCommands from ConfigBuilder] #12842
Comments
A new Issue was created by @slava77 (Slava Krutelyov). @davidlange6, @smuzaffar, @Degano, @davidlt, @Dr15Jones can you please review it and eventually sign/assign? Thanks. Following commands in first line of a comment are recognized
|
looks like I can't assign issues to categories (at least not to core) |
assign core |
New categories assigned: core @Dr15Jones,@smuzaffar you have been requested to review this Pull request/Issue and eventually sign? Thanks |
@slava77 can you provide a simple example of a configuration that when one does |
in CMSSW_7_5_6 (just because I had a test setup there)
Hope this makes it easier to follow. |
Maybe posting the part of the configuration which is trying to access |
I copied the config to ~slava77/public/py/RunPromptRecoCfg_issue12842.py on lxplus |
It took a while but I at least tracked down exactly what was happening. In Configuration/Applications/python/ConfigBuilder.py we have the following code if not self._options.inlineEventContent and hasattr(self.process,theStreamType+"EventContent"):
def doNotInlineEventContent(instance,label = "cms.untracked.vstring(process."+theStreamType+"EventContent.outputCommands)"):
return label
outputModule.outputCommands.__dict__["dumpPython"] = doNotInlineEventContent What this code does is remove the @davidlange6 Is this really a behavior you want us to support? |
At the Core meeting we decided to have |
#12870 makes the requested change |
+1 |
This issue is fully signed and ready to be closed. |
Context: DataProcessing-like configuration building is done with an instance of cms.Process and then manipulations by ConfigBuilder, the final configuration is made by Process::dumpPython call (there is no intermediate text config file like for configurations made by cmsDriver).
Symptoms: process instance made by ConfigBuilder in python can not have its output module outputCommands modified. (Note that customization works in python text config files.)
More explicitly, say, for the event content defined by RECOEventContent, it is possible to modify the RECOEventContent PSet by just calling process.someOuput.RECOEventContent.remove(something), but it will have no effect on the output modules creaded by ConfigBuilder.
By default the python output module objects made by ConfigBuilder have the content of outputCommands inlined immediately, which looses the relationship with the original PSet. This behavior can be changed by
inlineEventContent = False
option:it overrides the dict["dumpPython"] for outputCommands and leaves e.g.
process.someOutput.outputCommands = RECOEventContent.outputCommands
unchanged (not inlined). After this modification the process.dumpPython will leaveprocess.someOutput.outputCommands = RECOEventContent.outputCommands
as is and the dumped python is not runnable.Proposed solution: change the order of dumps in Process::dumpPython
https://github.com/cms-sw/cmssw/blob/CMSSW_7_6_3/FWCore/ParameterSet/python/Config.py#L708
Put the self.psets and self.vpsets (and maybe more) first, so that they can be interpreted inside the modules using the psets.
The text was updated successfully, but these errors were encountered: