Skip to content
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_3_X] Set concurrent lumis/IOVs in ConfigBuilder if their value is different from default regardless of the number of threads #37446

Merged
merged 2 commits into from Apr 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 16 additions & 11 deletions Configuration/Applications/python/ConfigBuilder.py
Expand Up @@ -2268,19 +2268,24 @@ def prepare(self, doChecking = False):
self.pythonCfgCode+="from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask\n"
self.pythonCfgCode+="associatePatAlgosToolsTask(process)\n"

if self._options.nThreads != "1":
overrideThreads = (self._options.nThreads != "1")
overrideConcurrentLumis = (self._options.nConcurrentLumis != defaultOptions.nConcurrentLumis)
overrideConcurrentIOVs = (self._options.nConcurrentIOVs != defaultOptions.nConcurrentIOVs)

if overrideThreads or overrideConcurrentLumis or overrideConcurrentIOVs:
self.pythonCfgCode +="\n"
self.pythonCfgCode +="#Setup FWK for multithreaded\n"
self.pythonCfgCode +="process.options.numberOfThreads = "+self._options.nThreads+"\n"
self.pythonCfgCode +="process.options.numberOfStreams = "+self._options.nStreams+"\n"
self.pythonCfgCode +="process.options.numberOfConcurrentLuminosityBlocks = "+self._options.nConcurrentLumis+"\n"
self.pythonCfgCode +="process.options.eventSetup.numberOfConcurrentIOVs = "+self._options.nConcurrentIOVs+"\n"
if int(self._options.nConcurrentLumis) > 1:
self.pythonCfgCode +="if hasattr(process, 'DQMStore'): process.DQMStore.assertLegacySafe=cms.untracked.bool(False)\n"
self.process.options.numberOfThreads = int(self._options.nThreads)
self.process.options.numberOfStreams = int(self._options.nStreams)
self.process.options.numberOfConcurrentLuminosityBlocks = int(self._options.nConcurrentLumis)
self.process.options.eventSetup.numberOfConcurrentIOVs = int(self._options.nConcurrentIOVs)
if overrideThreads:
self.pythonCfgCode +="process.options.numberOfThreads = "+self._options.nThreads+"\n"
self.pythonCfgCode +="process.options.numberOfStreams = "+self._options.nStreams+"\n"
self.process.options.numberOfThreads = int(self._options.nThreads)
self.process.options.numberOfStreams = int(self._options.nStreams)
if overrideConcurrentLumis:
self.pythonCfgCode +="process.options.numberOfConcurrentLuminosityBlocks = "+self._options.nConcurrentLumis+"\n"
self.process.options.numberOfConcurrentLuminosityBlocks = int(self._options.nConcurrentLumis)
if overrideConcurrentIOVs:
self.pythonCfgCode +="process.options.eventSetup.numberOfConcurrentIOVs = "+self._options.nConcurrentIOVs+"\n"
self.process.options.eventSetup.numberOfConcurrentIOVs = int(self._options.nConcurrentIOVs)

if self._options.accelerators is not None:
accelerators = self._options.accelerators.split(',')
Expand Down