Generate the full CFG needed to run the job and writes it to the job directory
Definition at line 382 of file production_tasks.py.
def production_tasks.FullCFG.run |
( |
|
self, |
|
|
|
input |
|
) |
| |
Definition at line 389 of file production_tasks.py.
References production_tasks.Task.dataset, edmIntegrityCheck.IntegrityCheck.dataset, genericValidation.GenericValidationData.dataset, FrontierConditions_GlobalTag_cff.file, production_tasks.insertLines(), createfilelist.int, EcalTPGParamReaderFromDB.user, dataset.BaseDataset.user, production_tasks.Task.user, popcon::RpcDataT.user, popcon::RpcObGasData.user, popcon::RpcDataV.user, popcon::RPCObPVSSmapData.user, popcon::RpcDataI.user, popcon::RpcDataFebmap.user, popcon::RpcDataUXC.user, popcon::RpcDataS.user, popcon::RpcDataGasMix.user, MatrixInjector.MatrixInjector.user, and EcalDBConnection.user.
391 jobdir = input[
'CreateJobDirectory'][
'JobDir']
393 if self.options.cfg
is None or not os.path.exists(self.options.cfg):
394 raise Exception(
"The file '%s' does not exist. Please check." % self.options.cfg)
396 config =
file(self.options.cfg).readlines()
397 sourceFile = os.path.basename(input[
'SourceCFG'][
'SourceCFG'])
398 if sourceFile.lower().endswith(
'.py'):
399 sourceFile = sourceFile[:-3]
401 source = os.path.join(jobdir,
'full_cfg.py')
402 output =
file(source,
'w')
405 if self.options.nEventsPerJob:
406 nEventsPerJob =
int(self.options.nEventsPerJob)
408 toInsert = [
'\nfrom %s import *\n' % sourceFile,
409 'process.source.fileNames = files\n',
410 'if hasattr(process,"maxEvents"): process.maxEvents.input = cms.untracked.int32({nEvents})\n'.
format(nEvents=nEventsPerJob),
411 'if hasattr(process,"maxLuminosityBlocks"): process.maxLuminosityBlocks.input = cms.untracked.int32(-1)\n' 412 'datasetInfo = ("%s","%s","%s")\n' % (self.
user, self.
dataset, fnmatch.translate(self.options.wildcard) )
415 output.writelines(config)
417 return {
'FullCFG':source}
def insertLines(insertedTo, toInsert)