CMS 3D CMS Logo

Functions

Utils Namespace Reference

Functions

def addMonitoring
def dictIO
def dqmIOSource
def dqmSeq
def harvestingMode
def stepALCAPRODUCER
def validateProcess

Function Documentation

def Utils::addMonitoring (   process)
_addMonitoring_

Add the monitoring services to the process provided
in order to write out performance summaries to the framework job report

Definition at line 23 of file Utils.py.

00024                           :
00025     """
00026     _addMonitoring_
00027     
00028     Add the monitoring services to the process provided
00029     in order to write out performance summaries to the framework job report
00030     """
00031     import FWCore.ParameterSet.Config as cms
00032     
00033     process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck",
00034                                             jobReportOutputOnly = cms.untracked.bool(True)
00035                                             )
00036     process.Timing = cms.Service("Timing",
00037                                  summaryOnly = cms.untracked.bool(True)
00038                                  )
00039     
00040     return process
00041 

def Utils::dictIO (   options,
  args 
)

Definition at line 108 of file Utils.py.

00109                         :
00110     if args.has_key('outputs'):
00111         options.outputDefinition = args['outputs'].__str__()
00112     else:
00113         writeTiers = args.get('writeTiers', [])
00114         options.eventcontent = ','.join(writeTiers)
00115         options.datatier = ','.join(writeTiers)

def Utils::dqmIOSource (   args)

Definition at line 88 of file Utils.py.

00089                      :
00090     import FWCore.ParameterSet.Config as cms
00091     if args.get('newDQMIO', False):
00092         return cms.Source("DQMRootSource",
00093                           fileNames = cms.untracked(cms.vstring())
00094                           )
00095     else:
00096         return cms.Source("PoolSource",
00097                           fileNames = cms.untracked(cms.vstring())
00098                           )

def Utils::dqmSeq (   args,
  default 
)

Definition at line 116 of file Utils.py.

00117                         :
00118     if 'dqmSeq' in args and len(args['dqmSeq'])!=0:
00119         return ':'+('+'.join(args['dqmSeq']))
00120     else:
00121         return default
00122             
def Utils::harvestingMode (   process,
  datasetName,
  args,
  rANDl = True 
)

Definition at line 99 of file Utils.py.

00100                                                          :
00101     import FWCore.ParameterSet.Config as cms
00102     if rANDl and (not args.get('newDQMIO', False)):
00103         process.source.processingMode = cms.untracked.string('RunsAndLumis')
00104     process.dqmSaver.workflow = datasetName
00105     process.dqmSaver.saveByLumiSection = 1
00106     if args.has_key('referenceFile') and args.get('referenceFile', ''):
00107         process.DQMStore.referenceFileName = cms.untracked.string(args['referenceFile'])

def Utils::stepALCAPRODUCER (   skims)
_stepALCAPRODUCER_

Creates and returns the configuration string for the ALCAPRODUCER step
starting from the list of AlcaReco path to be run.

Definition at line 9 of file Utils.py.

00010                            :
00011     """
00012     _stepALCAPRODUCER_
00013 
00014     Creates and returns the configuration string for the ALCAPRODUCER step
00015     starting from the list of AlcaReco path to be run.
00016 
00017     """
00018 
00019     step = ''
00020     if len(skims) >0:
00021         step = ',ALCAPRODUCER:'+('+'.join(skims))
00022     return step

def Utils::validateProcess (   process)
_validateProcess_

Check attributes of process are appropriate for production
This method returns nothing but will throw a RuntimeError for any issues it finds
likely to cause problems in the production system

Definition at line 42 of file Utils.py.

00043                             :
00044     """
00045     _validateProcess_
00046     
00047     Check attributes of process are appropriate for production
00048     This method returns nothing but will throw a RuntimeError for any issues it finds
00049     likely to cause problems in the production system
00050     
00051     """
00052     
00053     schedule=process.schedule_()
00054     paths=process.paths_()
00055     endpaths=process.endpaths_()
00056     
00057     # check output mods are in paths and have appropriate settings
00058     for outputModName in process.outputModules_().keys():
00059         outputMod = getattr(process, outputModName)
00060         if not hasattr(outputMod, 'dataset'):
00061             msg = "Process contains output module without dataset PSET: %s \n" % outputModName
00062             msg += " You need to add this PSET to this module to set dataTier and filterName\n"
00063             raise RuntimeError, msg
00064         ds=getattr(outputMod,'dataset')
00065         if not hasattr(ds, "dataTier"):
00066             msg = "Process contains output module without dataTier parameter: %s \n" % outputModName
00067             msg += " You need to add an untracked parameter to the dataset PSET of this module to set dataTier\n"
00068             raise RuntimeError, msg
00069 
00070         # check module in path or whatever (not sure of exact syntax for endpath)
00071         omRun=False
00072 
00073         if schedule==None:
00074             for path in paths:
00075                 if outputModName in getattr(process,path).moduleNames():
00076                     omRun=True
00077             for path in endpaths:
00078                 if outputModName in getattr(process,path).moduleNames():
00079                     omRun=True
00080         else:
00081             for path in schedule:
00082                 if outputModName in path.moduleNames():
00083                     omRun=True
00084         if omRun==False:
00085             msg = "Output Module %s not in endPath" % outputModName
00086             raise RuntimeError, msg
00087