-
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
LogicError when using dump_python config to run #37976
Comments
A new Issue was created by @srimanob Phat Srimanobhas. @Dr15Jones, @perrotta, @dpiparo, @makortel, @smuzaffar, @qliphy can you please review it and eventually sign/assign? Thanks. cms-bot commands are listed here |
So I ran the command you gave and I see the following in the python process.schedule = cms.Schedule(*[ process.digitisation_step, process.L1TrackTrigger_step, process.L1simulation_step, process.digi2raw_step, process.digitisation_step, process.L1TrackTrigger_step, process.L1simulation_step, process.digi2raw_step, process.HLTriggerFirstPath, process.HLT_Physics_v1, process.HLT_Random_v1, process.HLT_ZeroBias_v1, process.HLTriggerFinalPath, process.HLTAnalyzerEndpath, process.endjob_step, process.FEVTDEBUGHLToutput_step, process.endjob_step, process.FEVTDEBUGHLToutput_step ], tasks=[process.patAlgosToolsTask]) If I just use the python as generated by running # Schedule definition
# process.schedule imported from cff in HLTrigger.Configuration
process.schedule.insert(0, process.digitisation_step)
process.schedule.insert(1, process.L1TrackTrigger_step)
process.schedule.insert(2, process.L1simulation_step)
process.schedule.insert(3, process.digi2raw_step)
process.schedule.extend([process.endjob_step,process.FEVTDEBUGHLToutput_step]) If I interactively load the configuration for step2 generated by process.schedule = cms.Schedule(*[ process.digitisation_step, process.L1TrackTrigger_step, process.L1simulation_step, process.digi2raw_step, process.HLTriggerFirstPath, process.HLT_Physics_v1, process.HLT_Random_v1, process.HLT_ZeroBias_v1, process.HLTriggerFinalPath, process.HLTAnalyzerEndpath, process.endjob_step, process.FEVTDEBUGHLToutput_step ], tasks=[process.patAlgosToolsTask]) which does NOT show multiple It looks like cmsDriver.py's |
assign operations
I was coming to the same conclusion. |
New categories assigned: operations @fabiocos,@qliphy,@davidlange6,@perrotta you have been requested to review this Pull request/Issue and eventually sign? Thanks |
it looks like the problem happens in https://github.com/cms-sw/cmssw/blame/master/Configuration/Applications/python/ConfigBuilder.py#L2260 , commenting this line removes the duplication. Of course this does not mean it is the solution, the issue is likely due to the previous lines added in #35858 . |
Faced similar issue during test of alca validation workflows. Raised a PR to address this issue PR#39127. if options.dump_python:
result = {}
exec(open(options.python_filename).read(), result)
process = result["process"]
expanded = process.dumpPython()
expandedFile = open(options.python_filename,"w")
expandedFile.write(expanded)
expandedFile.close() Replaced those lines with if options.dump_python:
os.system('edmConfigDump -o {f} {f}'.format(f=options.python_filename)) |
Since this is somewhat related to #35858, I tried to understand the problem. My knowledge in I see that when process.load('HLTrigger.Configuration.HLT_Fake2_cff') but at the time of the [1] A possible workaround illustrating the above is the following diff --git a/Configuration/Applications/scripts/cmsDriver.py b/Configuration/Applications/scripts/cmsDriver.py
index a99a87a924f..24a69285436 100755
--- a/Configuration/Applications/scripts/cmsDriver.py
+++ b/Configuration/Applications/scripts/cmsDriver.py
@@ -33,6 +33,9 @@ def run():
# handle different dump options
if options.dump_python:
+ for cb_import in configBuilder.imports:
+ if cb_import in sys.modules:
+ del sys.modules[cb_import]
result = {}
exec(open(options.python_filename).read(), result)
process = result["process"] That said, I don't know what the best solution is. |
If the problem indeed is that the |
Agreed, and now it's clear that #35858 didn't comply with that policy. I think it would look like this [*]. The copy in the output cfg itself, i.e.
is not strictly necessary for the issue at hand, but I guess it'd be preferred? (given the policy) [*] diff --git a/Configuration/Applications/python/ConfigBuilder.py b/Configuration/Applications/python/ConfigBuilder.py
index 5397ed1505e..820890374c7 100644
--- a/Configuration/Applications/python/ConfigBuilder.py
+++ b/Configuration/Applications/python/ConfigBuilder.py
@@ -2250,13 +2250,20 @@ class ConfigBuilder(object):
if not isinstance(self.scheduleIndexOfFirstHLTPath, int):
raise Exception('the schedule was imported from a cff in HLTrigger.Configuration, but the final index of the first HLT path is undefined')
+ # copy the schedule imported from the cff file in HLTrigger.Configuration
+ # in order not to modify directly the object defined inside the cff
+ self.process.schedule = self.process.schedule.copy()
+
+ result = "# process.schedule imported from cff in HLTrigger.Configuration\n"
+ result += "# copied to guarantee no changes to the schedule defined in the cff file\n"
+ result += "process.schedule = process.schedule.copy()\n"
+
for index, item in enumerate(self.schedule):
if index < self.scheduleIndexOfFirstHLTPath:
self.process.schedule.insert(index, item)
else:
self.process.schedule.append(item)
- result = "# process.schedule imported from cff in HLTrigger.Configuration\n"
for index, item in enumerate(pathNames[:self.scheduleIndexOfFirstHLTPath]):
result += 'process.schedule.insert('+str(index)+', '+item+')\n'
if self.scheduleIndexOfFirstHLTPath < len(pathNames): |
The situation is somewhat convoluted. In a sense the From this point of view the problem arises from I suppose there is a choice to be made between treating |
What is the pros and cons to have |
Done. |
Testing workflow, i.e. 39434.75, all steps run fine. But when I try to dump_python from one of the step and use it to run, i.e.
cmsDriver.py step2 -s DIGI:pdigi_valid,L1TrackTrigger,L1,DIGI2RAW,HLT:@fake2 --conditions auto:phase2_realistic_T21 --datatier GEN-SIM-DIGI-RAW -n 10 --eventcontent FEVTDEBUGHLT --geometry Extended2026D88 --era Phase2C17I13M9 --python DigiTrigger_HLT75e33_2026D88.py -n 50 --no_exec --filein file:step1.root --fileout file:step2.root --nThreads 8 --dump_python
I get the LogicError,
The text was updated successfully, but these errors were encountered: