Skip to content

Commit

Permalink
Merge pull request #37445 from makortel/concurrentLumiConfigBuilder_1…
Browse files Browse the repository at this point in the history
…2_2_x

[12_2_X] Set concurrent lumis/IOVs in ConfigBuilder if their value is different from default regardless of the number of threads
  • Loading branch information
cmsbuild authored Apr 4, 2022
2 parents 29b9889 + fc522df commit 7aaa4a4
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions Configuration/Applications/python/ConfigBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2279,19 +2279,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)
#repacked version
if self._options.isRepacked:
self.pythonCfgCode +="\n"
Expand Down

0 comments on commit 7aaa4a4

Please sign in to comment.