Batch manager specific to cmsRun processes.
Definition at line 158 of file cmsBatch.py.
def cmsBatch.MyBatchManager.PrepareJobUser |
( |
|
self, |
|
|
|
jobDir, |
|
|
|
value |
|
) |
| |
Prepare one job. This function is called by the base class.
Definition at line 161 of file cmsBatch.py.
161 def PrepareJobUser(self, jobDir, value ):
162 '''Prepare one job. This function is called by the base class.'''
164 process.source = fullSource.clone()
167 scriptFileName = jobDir+
'/batchScript.sh'
168 scriptFile = open(scriptFileName,
'w')
169 storeDir = self.remoteOutputDir_.
replace(
'/castor/cern.ch/cms',
'')
170 mode = self.RunningMode(options.batch)
173 elif mode ==
'LOCAL':
176 os.system(
'chmod +x %s' % scriptFileName)
181 randSvc = RandomNumberServiceHelper(process.RandomNumberGeneratorService)
184 iFileMin = (value-1)*grouping
185 iFileMax = (value)*grouping
186 process.source.fileNames = fullSource.fileNames[iFileMin:iFileMax]
187 print(process.source)
188 cfgFile = open(jobDir+
'/run_cfg.py',
'w')
189 cfgFile.write(
'import FWCore.ParameterSet.Config as cms\n\n')
190 cfgFile.write(
'import os,sys\n')
192 cfgFile.write(
"sys.path.append('%s')\n" % os.path.dirname(jobDir) )
193 cfgFile.write(
'from base_cfg import *\n')
194 cfgFile.write(
'process.source = ' + process.source.dumpPython() +
'\n')
196 cfgFile.write(
'process.RandomNumberGeneratorService = ' + process.RandomNumberGeneratorService.dumpPython() +
'\n')
References cmsBatch.batchScriptCERN(), cmsBatch.batchScriptLocal(), print(), batchmanager.BatchManager.remoteOutputDir_, python.rootplot.root2matplotlib.replace(), and batchmanager.BatchManager.RunningMode().
Referenced by batchmanager.BatchManager.PrepareJob().