CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Properties | Private Member Functions | Private Attributes
Config.Process Class Reference
Inheritance diagram for Config.Process:

Public Member Functions

def __delattr__
 
def __init__
 
def __setattr__
 
def __setstate__
 
def add_
 
def addSubProcess
 
def aliases_
 
def analyzerNames
 
def analyzers_
 
def dumpConfig
 
def dumpPython
 
def endpaths_
 
def es_prefers_
 
def es_producers_
 
def es_sources_
 
def extend
 
def fillProcessDesc
 
def filterNames
 
def filters_
 
def finalpaths_
 
def globalReplace
 
def handleProcessAccelerators
 
def isUsingModifier
 
def load
 
def looper_
 
def name_
 
def outputModules_
 
def pathNames
 
def paths_
 
def prefer
 
def processAccelerators_
 
def producerNames
 
def producers_
 
def prune
 
def psets_
 
def resolve
 
def schedule_
 
def sequences_
 
def services_
 
def setLooper_
 
def setName_
 
def setPartialSchedule_
 
def setSchedule_
 
def setSource_
 
def setStrict
 
def source_
 
def splitPython
 
def subProcesses_
 
def switchProducerNames
 
def switchProducers_
 
def tasks_
 
def validate
 
def vpsets_
 

Static Public Member Functions

def defaultMaxEvents_
 
def defaultMaxLuminosityBlocks_
 
def defaultOptions_
 

Public Attributes

 maxEvents
 
 maxLuminosityBlocks
 
 MessageLogger
 
 options
 

Properties

 aliases = property(aliases_,doc="dictionary containing the aliases for the process")
 
 analyzers = property(analyzers_,doc="dictionary containing the analyzers for the process")
 
 endpaths = property(endpaths_,doc="dictionary containing the endpaths for the process")
 
 es_prefers = property(es_prefers_,doc="dictionary containing the es_prefers for the process")
 
 es_producers = property(es_producers_,doc="dictionary containing the es_producers for the process")
 
 es_sources = property(es_sources_,doc="dictionary containing the es_sources for the process")
 
 filters = property(filters_, doc="dictionary containing the filters for the process")
 
 finalpaths = property(finalpaths_,doc="dictionary containing the finalpaths for the process")
 
 looper = property(looper_,setLooper_,doc='the main looper or None if not set')
 
 outputModules = property(outputModules_,doc="dictionary containing the output_modules for the process")
 
 paths = property(paths_,doc="dictionary containing the paths for the process")
 
 process = property(name_,setName_, doc="name of the process")
 
 processAccelerators = property(processAccelerators_,doc="dictionary containing the ProcessAccelerators for the process")
 
 producers = property(producers_,doc="dictionary containing the producers for the process")
 
 psets = property(psets_,doc="dictionary containing the PSets for the process")
 
 schedule = property(schedule_,setSchedule_,doc='the schedule or None if not set')
 
 sequences = property(sequences_,doc="dictionary containing the sequences for the process")
 
 services = property(services_,doc="dictionary containing the services for the process")
 
 source = property(source_,setSource_,doc='the main source or None if not set')
 
 subProcesses = property(subProcesses_,doc='the SubProcesses that have been added to the Process')
 
 switchProducers = property(switchProducers_,doc="dictionary containing the SwitchProducers for the process")
 
 tasks = property(tasks_,doc="dictionary containing the tasks for the process")
 
 vpsets = property(vpsets_,doc="dictionary containing the PSets for the process")
 

Private Member Functions

def __findFirstUsingModule
 
def __setObjectLabel
 
def __updateMaxEvents
 
def __updateOptions
 
def _delattrFromSetattr
 
def _delHelper
 
def _dumpConfigESPrefers
 
def _dumpConfigNamedList
 
def _dumpConfigOptionallyNamedList
 
def _dumpConfigUnnamedList
 
def _dumpPython
 
def _dumpPythonList
 
def _dumpPythonSubProcesses
 
def _findPreferred
 
def _insertInto
 
def _insertManyInto
 
def _insertOneInto
 
def _insertPaths
 
def _insertSubProcessesInto
 
def _insertSwitchProducersInto
 
def _itemsInDependencyOrder
 
def _okToPlace
 
def _place
 
def _placeAccelerator
 
def _placeAlias
 
def _placeAnalyzer
 
def _placeEndPath
 
def _placeESPrefer
 
def _placeESProducer
 
def _placeESSource
 
def _placeFilter
 
def _placeFinalPath
 
def _placeLooper
 
def _placeOutputModule
 
def _placePath
 
def _placeProducer
 
def _placePSet
 
def _placeSequence
 
def _placeService
 
def _placeSource
 
def _placeSubProcess
 
def _placeSwitchProducer
 
def _placeTask
 
def _placeVPSet
 
def _pruneModules
 
def _replaceInSchedule
 
def _replaceInScheduleDirectly
 
def _replaceInSequences
 
def _replaceInTasks
 
def _splitPython
 
def _splitPythonList
 
def _validateSequence
 
def _validateTask
 

Private Attributes

 __isStrict
 
 __ppset
 
 __process
 
 __processPSet
 
 __thelist
 

Detailed Description

Root class for a CMS configuration process

Definition at line 102 of file Config.py.

Constructor & Destructor Documentation

def Config.Process.__init__ (   self,
  name,
  Mods 
)
The argument 'name' will be the name applied to this Process
    Can optionally pass as additional arguments cms.Modifier instances
    that will be used to modify the Process as it is built

Definition at line 104 of file Config.py.

Referenced by Config.Process.fillProcessDesc().

105  def __init__(self,name,*Mods):
106  """The argument 'name' will be the name applied to this Process
107  Can optionally pass as additional arguments cms.Modifier instances
108  that will be used to modify the Process as it is built
109  """
110  self.__dict__['_Process__name'] = name
111  if not name.isalnum():
112  raise RuntimeError("Error: The process name is an empty string or contains non-alphanumeric characters")
113  self.__dict__['_Process__filters'] = {}
114  self.__dict__['_Process__producers'] = {}
115  self.__dict__['_Process__switchproducers'] = {}
116  self.__dict__['_Process__source'] = None
117  self.__dict__['_Process__looper'] = None
118  self.__dict__['_Process__subProcesses'] = []
119  self.__dict__['_Process__schedule'] = None
120  self.__dict__['_Process__analyzers'] = {}
121  self.__dict__['_Process__outputmodules'] = {}
122  self.__dict__['_Process__paths'] = DictTypes.SortedKeysDict() # have to keep the order
123  self.__dict__['_Process__endpaths'] = DictTypes.SortedKeysDict() # of definition
124  self.__dict__['_Process__finalpaths'] = DictTypes.SortedKeysDict() # of definition
125  self.__dict__['_Process__sequences'] = {}
126  self.__dict__['_Process__tasks'] = {}
127  self.__dict__['_Process__services'] = {}
128  self.__dict__['_Process__essources'] = {}
129  self.__dict__['_Process__esproducers'] = {}
130  self.__dict__['_Process__esprefers'] = {}
131  self.__dict__['_Process__aliases'] = {}
132  self.__dict__['_Process__psets']={}
133  self.__dict__['_Process__vpsets']={}
134  self.__dict__['_cloneToObjectDict'] = {}
135  # policy switch to avoid object overwriting during extend/load
136  self.__dict__['_Process__InExtendCall'] = False
137  self.__dict__['_Process__partialschedules'] = {}
138  self.__isStrict = False
139  self.__dict__['_Process__modifiers'] = Mods
140  self.__dict__['_Process__accelerators'] = {}
141  self.options = Process.defaultOptions_()
142  self.maxEvents = Process.defaultMaxEvents_()
143  self.maxLuminosityBlocks = Process.defaultMaxLuminosityBlocks_()
144  # intentionally not cloned to ensure that everyone taking
145  # MessageLogger still via
146  # FWCore.Message(Logger|Service).MessageLogger_cfi
147  # use the very same MessageLogger object.
148  self.MessageLogger = MessageLogger
149  for m in self.__modifiers:
150  m._setChosen()
def __init__
Definition: Config.py:104

Member Function Documentation

def Config.Process.__delattr__ (   self,
  name 
)

Definition at line 565 of file Config.py.

References Config.Process._delHelper(), Config.Process._replaceInSchedule(), Config.Process._replaceInScheduleDirectly(), Config.Process._replaceInSequences(), and Config.Process._replaceInTasks().

566  def __delattr__(self,name):
567  self._delHelper(name)
568  obj = getattr(self,name)
569  if not obj is None:
570  if not isinstance(obj, Sequence) and not isinstance(obj, Task):
571  # For modules, ES modules and services we can also remove
572  # the deleted object from Sequences, Paths, EndPaths, and
573  # Tasks. Note that for Sequences and Tasks that cannot be done
574  # reliably as the places where the Sequence or Task was used
575  # might have been expanded so we do not even try. We considered
576  # raising an exception if a Sequences or Task was explicitly
577  # deleted, but did not because when done carefully deletion
578  # is sometimes OK (for example in the prune function where it
579  # has been checked that the deleted Sequence is not used).
580  if obj._isTaskComponent():
581  self._replaceInTasks(name, None)
582  self._replaceInSchedule(name, None)
583  if isinstance(obj, _Sequenceable) or obj._isTaskComponent():
584  self._replaceInSequences(name, None)
585  if Schedule._itemIsValid(obj) or isinstance(obj, Task):
586  self._replaceInScheduleDirectly(name, None)
587  # now remove it from the process itself
588  try:
589  del self.__dict__[name]
590  except:
591  pass
def _replaceInSequences
Definition: Config.py:1104
def __delattr__
Definition: Config.py:565
def _delHelper
Definition: Config.py:548
def _replaceInSchedule
Definition: Config.py:1125
def _replaceInScheduleDirectly
Definition: Config.py:1131
def _replaceInTasks
Definition: Config.py:1121
def Config.Process.__findFirstUsingModule (   self,
  seqsOrTasks,
  mod 
)
private
Given a container of sequences or tasks, find the first sequence or task
containing mod and return it. If none is found, return None

Definition at line 535 of file Config.py.

Referenced by Config.Process.__setattr__().

536  def __findFirstUsingModule(self, seqsOrTasks, mod):
537  """Given a container of sequences or tasks, find the first sequence or task
538  containing mod and return it. If none is found, return None"""
539  from FWCore.ParameterSet.SequenceTypes import ModuleNodeVisitor
540  l = list()
541  for seqOrTask in seqsOrTasks.values():
542  l[:] = []
543  v = ModuleNodeVisitor(l)
544  seqOrTask.visit(v)
545  if mod in l:
546  return seqOrTask
547  return None
def __findFirstUsingModule
Definition: Config.py:535
def Config.Process.__setattr__ (   self,
  name,
  value 
)

Definition at line 394 of file Config.py.

References Config.Process.__findFirstUsingModule(), Config.Process.__isStrict, Config.Process.__setObjectLabel(), Config.Process.__updateMaxEvents(), Config.Process.__updateOptions(), Config.Process._delattrFromSetattr(), Config.Process._okToPlace(), Config.Process._replaceInSchedule(), Config.Process._replaceInScheduleDirectly(), Config.Process._replaceInSequences(), Config.Process._replaceInTasks(), Config.Process.add_(), Config.Process.endpaths, Config.Process.finalpaths, gpuClustering.id, Config.Process.paths, Config.Process.sequences, str, and Config.Process.tasks.

Referenced by Config.Process._findPreferred(), and Config.Process.extend().

395  def __setattr__(self,name,value):
396  # check if the name is well-formed (only _ and alphanumerics are allowed)
397  if not name.replace('_','').isalnum():
398  raise ValueError('The label '+name+' contains forbiden characters')
399 
400  if name == 'options':
401  value = self.__updateOptions(value)
402  if name == 'maxEvents':
403  value = self.__updateMaxEvents(value)
404 
405  # private variable exempt from all this
406  if name.startswith('_Process__'):
407  self.__dict__[name]=value
408  return
409  if not isinstance(value,_ConfigureComponent):
410  raise TypeError("can only assign labels to an object that inherits from '_ConfigureComponent'\n"
411  +"an instance of "+str(type(value))+" will not work - requested label is "+name)
412  if not isinstance(value,_Labelable) and not isinstance(value,Source) and not isinstance(value,Looper) and not isinstance(value,Schedule):
413  if name == value.type_():
414  # Only Services get handled here
415  self.add_(value)
416  return
417  else:
418  raise TypeError("an instance of "+str(type(value))+" can not be assigned the label '"+name+"'.\n"+
419  "Please either use the label '"+value.type_()+" or use the 'add_' method instead.")
420  #clone the item
421  if self.__isStrict:
422  newValue =value.copy()
423  try:
424  newValue._filename = value._filename
425  except:
426  pass
427  value.setIsFrozen()
428  else:
429  newValue =value
430  if not self._okToPlace(name, value, self.__dict__):
431  newFile='top level config'
432  if hasattr(value,'_filename'):
433  newFile = value._filename
434  oldFile='top level config'
435  oldValue = getattr(self,name)
436  if hasattr(oldValue,'_filename'):
437  oldFile = oldValue._filename
438  msg = "Trying to override definition of process."+name
439  msg += "\n new object defined in: "+newFile
440  msg += "\n existing object defined in: "+oldFile
441  raise ValueError(msg)
442  # remove the old object of the name (if there is one)
443  if hasattr(self,name) and not (getattr(self,name)==newValue):
444  # Complain if items in sequences or tasks from load() statements have
445  # degenerate names, but if the user overwrites a name in the
446  # main config, replace it everywhere
447  if newValue._isTaskComponent():
448  if not self.__InExtendCall:
449  self._replaceInTasks(name, newValue)
450  self._replaceInSchedule(name, newValue)
451  else:
452  if not isinstance(newValue, Task):
453  #should check to see if used in task before complaining
454  newFile='top level config'
455  if hasattr(value,'_filename'):
456  newFile = value._filename
457  oldFile='top level config'
458  oldValue = getattr(self,name)
459  if hasattr(oldValue,'_filename'):
460  oldFile = oldValue._filename
461  msg1 = "Trying to override definition of "+name+" while it is used by the task "
462  msg2 = "\n new object defined in: "+newFile
463  msg2 += "\n existing object defined in: "+oldFile
464  s = self.__findFirstUsingModule(self.tasks,oldValue)
465  if s is not None:
466  raise ValueError(msg1+s.label_()+msg2)
467 
468  if isinstance(newValue, _Sequenceable) or newValue._isTaskComponent():
469  if not self.__InExtendCall:
470  self._replaceInSequences(name, newValue)
471  else:
472  #should check to see if used in sequence before complaining
473  newFile='top level config'
474  if hasattr(value,'_filename'):
475  newFile = value._filename
476  oldFile='top level config'
477  oldValue = getattr(self,name)
478  if hasattr(oldValue,'_filename'):
479  oldFile = oldValue._filename
480  msg1 = "Trying to override definition of "+name+" while it is used by the "
481  msg2 = "\n new object defined in: "+newFile
482  msg2 += "\n existing object defined in: "+oldFile
483  s = self.__findFirstUsingModule(self.sequences,oldValue)
484  if s is not None:
485  raise ValueError(msg1+"sequence "+s.label_()+msg2)
486  s = self.__findFirstUsingModule(self.paths,oldValue)
487  if s is not None:
488  raise ValueError(msg1+"path "+s.label_()+msg2)
489  s = self.__findFirstUsingModule(self.endpaths,oldValue)
490  if s is not None:
491  raise ValueError(msg1+"endpath "+s.label_()+msg2)
492  s = self.__findFirstUsingModule(self.finalpaths,oldValue)
493  if s is not None:
494  raise ValueError(msg1+"finalpath "+s.label_()+msg2)
495 
496  # In case of EDAlias, raise Exception always to avoid surprises
497  if isinstance(newValue, EDAlias):
498  oldValue = getattr(self, name)
499  #should check to see if used in task/sequence before complaining
500  newFile='top level config'
501  if hasattr(value,'_filename'):
502  newFile = value._filename
503  oldFile='top level config'
504  if hasattr(oldValue,'_filename'):
505  oldFile = oldValue._filename
506  msg1 = "Trying to override definition of "+name+" with an EDAlias while it is used by the "
507  msg2 = "\n new object defined in: "+newFile
508  msg2 += "\n existing object defined in: "+oldFile
509  s = self.__findFirstUsingModule(self.tasks,oldValue)
510  if s is not None:
511  raise ValueError(msg1+"task "+s.label_()+msg2)
512  s = self.__findFirstUsingModule(self.sequences,oldValue)
513  if s is not None:
514  raise ValueError(msg1+"sequence "+s.label_()+msg2)
515  s = self.__findFirstUsingModule(self.paths,oldValue)
516  if s is not None:
517  raise ValueError(msg1+"path "+s.label_()+msg2)
518  s = self.__findFirstUsingModule(self.endpaths,oldValue)
519  if s is not None:
520  raise ValueError(msg1+"endpath "+s.label_()+msg2)
521  s = self.__findFirstUsingModule(self.finalpaths,oldValue)
522  if s is not None:
523  raise ValueError(msg1+"finalpath "+s.label_()+msg2)
524 
525  if not self.__InExtendCall and (Schedule._itemIsValid(newValue) or isinstance(newValue, Task)):
526  self._replaceInScheduleDirectly(name, newValue)
527 
528  self._delattrFromSetattr(name)
529  self.__dict__[name]=newValue
530  if isinstance(newValue,_Labelable):
531  self.__setObjectLabel(newValue, name)
532  self._cloneToObjectDict[id(value)] = newValue
533  self._cloneToObjectDict[id(newValue)] = newValue
534  #now put in proper bucket
newValue._place(name,self)
def __setObjectLabel
Definition: Config.py:367
def _replaceInSequences
Definition: Config.py:1104
uint16_t *__restrict__ id
def _okToPlace
Definition: Config.py:616
def _replaceInSchedule
Definition: Config.py:1125
def __updateMaxEvents
Definition: Config.py:263
def __setattr__
Definition: Config.py:394
def _replaceInScheduleDirectly
Definition: Config.py:1131
def __findFirstUsingModule
Definition: Config.py:535
def __updateOptions
Definition: Config.py:250
def _replaceInTasks
Definition: Config.py:1121
#define str(s)
def _delattrFromSetattr
Definition: Config.py:592
def Config.Process.__setObjectLabel (   self,
  object,
  newLabel 
)
private

Definition at line 367 of file Config.py.

References gpuClustering.id, and str.

Referenced by Config.Process.__setattr__(), Config.Process._place(), and Config.Process.extend().

368  def __setObjectLabel(self, object, newLabel) :
369  if not object.hasLabel_() :
370  object.setLabel(newLabel)
371  return
372  if newLabel == object.label_() :
373  return
374  if newLabel is None :
375  object.setLabel(None)
376  return
377  if (hasattr(self, object.label_()) and id(getattr(self, object.label_())) == id(object)) :
378  msg100 = "Attempting to change the label of an attribute of the Process\n"
379  msg101 = "Old label = "+object.label_()+" New label = "+newLabel+"\n"
380  msg102 = "Type = "+str(type(object))+"\n"
381  msg103 = "Some possible solutions:\n"
382  msg104 = " 1. Clone modules instead of using simple assignment. Cloning is\n"
383  msg105 = " also preferred for other types when possible.\n"
384  msg106 = " 2. Declare new names starting with an underscore if they are\n"
385  msg107 = " for temporaries you do not want propagated into the Process. The\n"
386  msg108 = " underscore tells \"from x import *\" and process.load not to import\n"
387  msg109 = " the name.\n"
388  msg110 = " 3. Reorganize so the assigment is not necessary. Giving a second\n"
389  msg111 = " name to the same object usually causes confusion and problems.\n"
390  msg112 = " 4. Compose Sequences: newName = cms.Sequence(oldName)\n"
391  raise ValueError(msg100+msg101+msg102+msg103+msg104+msg105+msg106+msg107+msg108+msg109+msg110+msg111+msg112)
392  object.setLabel(None)
393  object.setLabel(newLabel)
def __setObjectLabel
Definition: Config.py:367
uint16_t *__restrict__ id
#define str(s)
def Config.Process.__setstate__ (   self,
  pkldict 
)
Unpickling hook.

Since cloneToObjectDict stores a hash of objects by their
id() it needs to be updated when unpickling to use the
new object id values instantiated during the unpickle.

Definition at line 172 of file Config.py.

References gpuClustering.id.

173  def __setstate__(self, pkldict):
174  """
175  Unpickling hook.
176 
177  Since cloneToObjectDict stores a hash of objects by their
178  id() it needs to be updated when unpickling to use the
179  new object id values instantiated during the unpickle.
180 
181  """
182  self.__dict__.update(pkldict)
183  tmpDict = {}
184  for value in self._cloneToObjectDict.values():
185  tmpDict[id(value)] = value
186  self.__dict__['_cloneToObjectDict'] = tmpDict
187 
188 
uint16_t *__restrict__ id
def __setstate__
Definition: Config.py:172
def Config.Process.__updateMaxEvents (   self,
  ps 
)
private

Definition at line 263 of file Config.py.

References Config.Process.defaultMaxEvents_().

Referenced by Config.Process.__setattr__().

264  def __updateMaxEvents(self,ps):
265  newMax = self.defaultMaxEvents_()
266  if isinstance(ps,dict):
267  for k,v in ps.items():
268  setattr(newMax,k,v)
269  else:
270  for p in ps.parameters_():
271  setattr(newMax, p, getattr(ps,p))
return newMax
def __updateMaxEvents
Definition: Config.py:263
def defaultMaxEvents_
Definition: Config.py:260
def Config.Process.__updateOptions (   self,
  opt 
)
private

Definition at line 250 of file Config.py.

References Config.Process.defaultOptions_().

Referenced by Config.Process.__setattr__().

251  def __updateOptions(self,opt):
252  newOpts = self.defaultOptions_()
253  if isinstance(opt,dict):
254  for k,v in opt.items():
255  setattr(newOpts,k,v)
256  else:
257  for p in opt.parameters_():
258  setattr(newOpts, p, getattr(opt,p))
return newOpts
def __updateOptions
Definition: Config.py:250
def defaultOptions_
Definition: Config.py:221
def Config.Process._delattrFromSetattr (   self,
  name 
)
private
Similar to __delattr__ but we need different behavior when called from __setattr__

Definition at line 592 of file Config.py.

References Config.Process._delHelper().

Referenced by Config.Process.__setattr__().

593  def _delattrFromSetattr(self,name):
594  """Similar to __delattr__ but we need different behavior when called from __setattr__"""
595  self._delHelper(name)
596  # now remove it from the process itself
597  try:
598  del self.__dict__[name]
599  except:
600  pass
def _delHelper
Definition: Config.py:548
def _delattrFromSetattr
Definition: Config.py:592
def Config.Process._delHelper (   self,
  name 
)
private

Definition at line 548 of file Config.py.

Referenced by Config.Process.__delattr__(), and Config.Process._delattrFromSetattr().

549  def _delHelper(self,name):
550  if not hasattr(self,name):
551  raise KeyError('process does not know about '+name)
552  elif name.startswith('_Process__'):
553  raise ValueError('this attribute cannot be deleted')
554 
555  # we have to remove it from all dictionaries/registries
556  dicts = [item for item in self.__dict__.values() if (isinstance(item, dict) or isinstance(item, DictTypes.SortedKeysDict))]
557  for reg in dicts:
558  if name in reg: del reg[name]
559  # if it was a labelable object, the label needs to be removed
560  obj = getattr(self,name)
561  if isinstance(obj,_Labelable):
562  obj.setLabel(None)
563  if isinstance(obj,Service):
564  obj._inProcess = False
def _delHelper
Definition: Config.py:548
def Config.Process._dumpConfigESPrefers (   self,
  options 
)
private

Definition at line 867 of file Config.py.

References Config.Process.es_prefers_(), and makeHLTPrescaleTable.values.

Referenced by Config.Process.dumpConfig().

868  def _dumpConfigESPrefers(self, options):
869  result = ''
870  for item in self.es_prefers_().values():
871  result +=options.indentation()+'es_prefer '+item.targetLabel_()+' = '+item.dumpConfig(options)
872  return result
def _dumpConfigESPrefers
Definition: Config.py:867
def es_prefers_
Definition: Config.py:342
def Config.Process._dumpConfigNamedList (   self,
  items,
  typeName,
  options 
)
private

Definition at line 778 of file Config.py.

Referenced by Config.Process.dumpConfig().

779  def _dumpConfigNamedList(self,items,typeName,options):
780  returnValue = ''
781  for name,item in items:
782  returnValue +=options.indentation()+typeName+' '+name+' = '+item.dumpConfig(options)
783  return returnValue
def _dumpConfigNamedList
Definition: Config.py:778
def Config.Process._dumpConfigOptionallyNamedList (   self,
  items,
  typeName,
  options 
)
private

Definition at line 790 of file Config.py.

Referenced by Config.Process.dumpConfig().

791  def _dumpConfigOptionallyNamedList(self,items,typeName,options):
792  returnValue = ''
793  for name,item in items:
794  if name == item.type_():
795  name = ''
796  returnValue +=options.indentation()+typeName+' '+name+' = '+item.dumpConfig(options)
797  return returnValue
def _dumpConfigOptionallyNamedList
Definition: Config.py:790
def Config.Process._dumpConfigUnnamedList (   self,
  items,
  typeName,
  options 
)
private

Definition at line 784 of file Config.py.

Referenced by Config.Process.dumpConfig().

785  def _dumpConfigUnnamedList(self,items,typeName,options):
786  returnValue = ''
787  for name,item in items:
788  returnValue +=options.indentation()+typeName+' = '+item.dumpConfig(options)
789  return returnValue
def _dumpConfigUnnamedList
Definition: Config.py:784
def Config.Process._dumpPython (   self,
  d,
  options 
)
private

Definition at line 985 of file Config.py.

Referenced by Config.Process.dumpPython().

986  def _dumpPython(self, d, options):
987  result = ''
988  for name, value in sorted(d.items()):
989  result += value.dumpPythonAs(name,options)+'\n'
990  return result
def _dumpPython
Definition: Config.py:985
def Config.Process._dumpPythonList (   self,
  d,
  options 
)
private

Definition at line 879 of file Config.py.

Referenced by Config.Process.dumpPython().

880  def _dumpPythonList(self, d, options):
881  returnValue = ''
882  if isinstance(d, DictTypes.SortedKeysDict):
883  for name,item in d.items():
884  returnValue +='process.'+name+' = '+item.dumpPython(options)+'\n\n'
885  else:
886  for name,item in sorted(d.items()):
887  returnValue +='process.'+name+' = '+item.dumpPython(options)+'\n\n'
888  return returnValue
def _dumpPythonList
Definition: Config.py:879
def Config.Process._dumpPythonSubProcesses (   self,
  l,
  options 
)
private

Definition at line 873 of file Config.py.

Referenced by Config.Process.dumpPython().

874  def _dumpPythonSubProcesses(self, l, options):
875  returnValue = ''
876  for item in l:
877  returnValue += item.dumpPython(options)+'\n\n'
878  return returnValue
def _dumpPythonSubProcesses
Definition: Config.py:873
def Config.Process._findPreferred (   self,
  esname,
  d,
  args,
  kargs 
)
private

Definition at line 1516 of file Config.py.

References psClasses.BuildTreeNode.__setattr__(), Config.Process.__setattr__(), and Config.FilteredStream.__setattr__.

Referenced by Config.Process.prefer().

1517  def _findPreferred(self, esname, d,*args,**kargs):
1518  # is esname a name in the dictionary?
1519  if esname in d:
1520  typ = d[esname].type_()
1521  if typ == esname:
1522  self.__setattr__( esname+"_prefer", ESPrefer(typ,*args,**kargs) )
1523  else:
1524  self.__setattr__( esname+"_prefer", ESPrefer(typ, esname,*args,**kargs) )
1525  return True
1526  else:
1527  # maybe it's an unnamed ESModule?
1528  found = False
1529  for name, value in d.items():
1530  if value.type_() == esname:
1531  if found:
1532  raise RuntimeError("More than one ES module for "+esname)
1533  found = True
1534  self.__setattr__(esname+"_prefer", ESPrefer(d[esname].type_()) )
1535  return found
1536 
def _findPreferred
Definition: Config.py:1516
def __setattr__
Definition: Config.py:394
def Config.Process._insertInto (   self,
  parameterSet,
  itemDict 
)
private

Definition at line 1141 of file Config.py.

1142  def _insertInto(self, parameterSet, itemDict):
1143  for name,value in itemDict.items():
value.insertInto(parameterSet, name)
def _insertInto
Definition: Config.py:1141
def Config.Process._insertManyInto (   self,
  parameterSet,
  label,
  itemDict,
  tracked 
)
private

Definition at line 1151 of file Config.py.

1152  def _insertManyInto(self, parameterSet, label, itemDict, tracked):
1153  l = []
1154  for name,value in itemDict.items():
1155  value.appendToProcessDescList_(l, name)
1156  value.insertInto(parameterSet, name)
1157  # alphabetical order is easier to compare with old language
1158  l.sort()
parameterSet.addVString(tracked, label, l)
def _insertManyInto
Definition: Config.py:1151
def Config.Process._insertOneInto (   self,
  parameterSet,
  label,
  item,
  tracked 
)
private

Definition at line 1144 of file Config.py.

1145  def _insertOneInto(self, parameterSet, label, item, tracked):
1146  vitems = []
1147  if not item == None:
1148  newlabel = item.nameInProcessDesc_(label)
1149  vitems = [newlabel]
1150  item.insertInto(parameterSet, newlabel)
parameterSet.addVString(tracked, label, vitems)
def _insertOneInto
Definition: Config.py:1144
def Config.Process._insertPaths (   self,
  processPSet,
  nodeVisitor 
)
private

Definition at line 1183 of file Config.py.

References Config.Process.endpaths_(), FastTimerService::PlotsPerProcess.endpaths_, Config.Process.finalpaths_(), join(), edm::MainParameterSet.paths_, edm::HLTGlobalStatus.paths_, heppy::TriggerBitChecker.paths_, edm::PathsAndConsumesOfModules.paths_, ProcessCallGraph::ProcessType.paths_, pat::TriggerEvent.paths_, HLTPerformanceInfo.paths_, Config.Process.paths_(), FastTimerService::PlotsPerProcess.paths_, EcalDQMonitorTask.schedule_, edm::ModuleChanger.schedule_, edm::ScheduleInfo.schedule_, edm::PathsAndConsumesOfModules.schedule_, edm::SubProcess.schedule_, Config.Process.schedule_(), edm::EventProcessor.schedule_, and edm::test::TestProcessor.schedule_.

1184  def _insertPaths(self, processPSet, nodeVisitor):
1185  scheduledPaths = []
1186  triggerPaths = []
1187  endpaths = []
1188  finalpaths = []
1189  if self.schedule_() == None:
1190  # make one from triggerpaths & endpaths
1191  for name in self.paths_():
1192  scheduledPaths.append(name)
1193  triggerPaths.append(name)
1194  for name in self.endpaths_():
1195  scheduledPaths.append(name)
1196  endpaths.append(name)
1197  for name in self.finalpaths_():
1198  finalpaths.append(name)
1199  else:
1200  for path in self.schedule_():
1201  pathname = path.label_()
1202  if pathname in self.endpaths_():
1203  endpaths.append(pathname)
1204  scheduledPaths.append(pathname)
1205  elif pathname in self.finalpaths_():
1206  finalpaths.append(pathname)
1207  else:
1208  scheduledPaths.append(pathname)
1209  triggerPaths.append(pathname)
1210  for task in self.schedule_()._tasks:
1211  task.resolve(self.__dict__)
1212  scheduleTaskValidator = ScheduleTaskValidator()
1213  task.visit(scheduleTaskValidator)
1214  task.visit(nodeVisitor)
1215  # consolidate all final_paths into one EndPath
1216  endPathWithFinalPathModulesName ="@finalPath"
1217  finalPathEndPath = EndPath()
1218  if finalpaths:
1219  endpaths.append(endPathWithFinalPathModulesName)
1220  scheduledPaths.append(endPathWithFinalPathModulesName)
1221  finalpathValidator = FinalPathValidator()
1222  modulesOnFinalPath = []
1223  for finalpathname in finalpaths:
1224  iFinalPath = self.finalpaths_()[finalpathname]
1225  iFinalPath.resolve(self.__dict__)
1226  finalpathValidator.setLabel(finalpathname)
1227  iFinalPath.visit(finalpathValidator)
1228  if finalpathValidator.filtersOnFinalpaths or finalpathValidator.producersOnFinalpaths:
1229  names = [p.label_ for p in finalpathValidator.filtersOnFinalpaths]
1230  names.extend( [p.label_ for p in finalpathValidator.producersOnFinalpaths])
1231  raise RuntimeError("FinalPath %s has non OutputModules %s" % (finalpathname, ",".join(names)))
1232  modulesOnFinalPath.extend(iFinalPath.moduleNames())
1233  for m in modulesOnFinalPath:
1234  mod = getattr(self, m)
1235  setattr(mod, "@onFinalPath", untracked.bool(True))
1236  finalPathEndPath += mod
1237 
1238  processPSet.addVString(True, "@end_paths", endpaths)
1239  processPSet.addVString(True, "@paths", scheduledPaths)
1240  # trigger_paths are a little different
1241  p = processPSet.newPSet()
1242  p.addVString(True, "@trigger_paths", triggerPaths)
1243  processPSet.addPSet(True, "@trigger_paths", p)
1244  # add all these paths
1245  pathValidator = PathValidator()
1246  endpathValidator = EndPathValidator()
1247  decoratedList = []
1248  lister = DecoratedNodeNameVisitor(decoratedList)
1249  pathCompositeVisitor = CompositeVisitor(pathValidator, nodeVisitor, lister)
1250  endpathCompositeVisitor = CompositeVisitor(endpathValidator, nodeVisitor, lister)
1251  for triggername in triggerPaths:
1252  iPath = self.paths_()[triggername]
1253  iPath.resolve(self.__dict__)
1254  pathValidator.setLabel(triggername)
1255  lister.initialize()
1256  iPath.visit(pathCompositeVisitor)
1257  iPath.insertInto(processPSet, triggername, decoratedList)
1258  for endpathname in endpaths:
1259  if endpathname is not endPathWithFinalPathModulesName:
1260  iEndPath = self.endpaths_()[endpathname]
1261  else:
1262  iEndPath = finalPathEndPath
1263  iEndPath.resolve(self.__dict__)
1264  endpathValidator.setLabel(endpathname)
1265  lister.initialize()
1266  iEndPath.visit(endpathCompositeVisitor)
1267  iEndPath.insertInto(processPSet, endpathname, decoratedList)
1268  processPSet.addVString(False, "@filters_on_endpaths", endpathValidator.filtersOnEndpaths)
1269 
def _insertPaths
Definition: Config.py:1183
def schedule_
Definition: Config.py:307
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def finalpaths_
Definition: Config.py:295
def endpaths_
Definition: Config.py:291
def Config.Process._insertSubProcessesInto (   self,
  parameterSet,
  label,
  itemList,
  tracked 
)
private

Definition at line 1170 of file Config.py.

1171  def _insertSubProcessesInto(self, parameterSet, label, itemList, tracked):
1172  l = []
1173  subprocs = []
1174  for value in itemList:
1175  name = value.getProcessName()
1176  newLabel = value.nameInProcessDesc_(name)
1177  l.append(newLabel)
1178  pset = value.getSubProcessPSet(parameterSet)
1179  subprocs.append(pset)
1180  # alphabetical order is easier to compare with old language
1181  l.sort()
1182  parameterSet.addVString(tracked, label, l)
parameterSet.addVPSet(False,"subProcesses",subprocs)
def _insertSubProcessesInto
Definition: Config.py:1170
def Config.Process._insertSwitchProducersInto (   self,
  parameterSet,
  labelModules,
  labelAliases,
  itemDict,
  tracked 
)
private

Definition at line 1159 of file Config.py.

1160  def _insertSwitchProducersInto(self, parameterSet, labelModules, labelAliases, itemDict, tracked):
1161  modules = parameterSet.getVString(tracked, labelModules)
1162  aliases = parameterSet.getVString(tracked, labelAliases)
1163  accelerators = parameterSet.getVString(False, "@selected_accelerators")
1164  for name,value in itemDict.items():
1165  value.appendToProcessDescLists_(modules, aliases, name)
1166  value.insertInto(parameterSet, name, accelerators)
1167  modules.sort()
1168  aliases.sort()
1169  parameterSet.addVString(tracked, labelModules, modules)
parameterSet.addVString(tracked, labelAliases, aliases)
def _insertSwitchProducersInto
Definition: Config.py:1159
def Config.Process._itemsInDependencyOrder (   self,
  processDictionaryOfItems 
)
private

Definition at line 928 of file Config.py.

Referenced by Config.Process.dumpPython(), and Config.Process.splitPython().

929  def _itemsInDependencyOrder(self, processDictionaryOfItems):
930  # The items can be Sequences or Tasks and the input
931  # argument should either be the dictionary of sequences
932  # or the dictionary of tasks from the process.
933 
934  returnValue=DictTypes.SortedKeysDict()
935 
936  # For each item, see what other items it depends upon
937  # For our purpose here, an item depends on the items it contains.
938  dependencies = {}
939  for label,item in processDictionaryOfItems.items():
940  containedItems = []
941  if isinstance(item, Task):
942  v = TaskVisitor(containedItems)
943  else:
944  v = SequenceVisitor(containedItems)
945  try:
946  item.visit(v)
947  except RuntimeError:
948  if isinstance(item, Task):
949  raise RuntimeError("Failed in a Task visitor. Probably " \
950  "a circular dependency discovered in Task with label " + label)
951  else:
952  raise RuntimeError("Failed in a Sequence visitor. Probably a " \
953  "circular dependency discovered in Sequence with label " + label)
954  for containedItem in containedItems:
955  # Check for items that both have labels and are not in the process.
956  # This should not normally occur unless someone explicitly assigns a
957  # label without putting the item in the process (which should not ever
958  # be done). We check here because this problem could cause the code
959  # in the 'while' loop below to go into an infinite loop.
960  if containedItem.hasLabel_():
961  testItem = processDictionaryOfItems.get(containedItem.label_())
962  if testItem is None or containedItem != testItem:
963  if isinstance(item, Task):
964  raise RuntimeError("Task has a label, but using its label to get an attribute" \
965  " from the process yields a different object or None\n"+
966  "label = " + containedItem.label_())
967  else:
968  raise RuntimeError("Sequence has a label, but using its label to get an attribute" \
969  " from the process yields a different object or None\n"+
970  "label = " + containedItem.label_())
971  dependencies[label]=[dep.label_() for dep in containedItems if dep.hasLabel_()]
972 
973  # keep looping until we get rid of all dependencies
974  while dependencies:
975  oldDeps = dict(dependencies)
976  for label,deps in oldDeps.items():
977  if len(deps)==0:
978  returnValue[label]=processDictionaryOfItems[label]
979  #remove this as a dependency for all other tasks
980  del dependencies[label]
981  for lb2,deps2 in dependencies.items():
982  while deps2.count(label):
983  deps2.remove(label)
984  return returnValue
def _itemsInDependencyOrder
Definition: Config.py:928
def Config.Process._okToPlace (   self,
  name,
  mod,
  d 
)
private

Definition at line 616 of file Config.py.

References Config.Process.__isStrict.

Referenced by Config.Process.__setattr__(), and Config.Process._place().

617  def _okToPlace(self, name, mod, d):
618  if not self.__InExtendCall:
619  # if going
620  return True
621  elif not self.__isStrict:
622  return True
623  elif name in d:
624  # if there's an old copy, and the new one
625  # hasn't been modified, we're done. Still
626  # not quite safe if something has been defined twice.
627  # Need to add checks
628  if mod._isModified:
629  if d[name]._isModified:
630  return False
631  else:
632  return True
633  else:
634  return True
635  else:
636  return True
def _okToPlace
Definition: Config.py:616
def Config.Process._place (   self,
  name,
  mod,
  d 
)
private

Definition at line 637 of file Config.py.

References Config.Process.__isStrict, Config.Process.__setObjectLabel(), and Config.Process._okToPlace().

Referenced by Config.Process._placeAccelerator(), Config.Process._placeAlias(), Config.Process._placeAnalyzer(), Config.Process._placeEndPath(), Config.Process._placeESPrefer(), Config.Process._placeESProducer(), Config.Process._placeESSource(), Config.Process._placeFilter(), Config.Process._placeFinalPath(), Config.Process._placeOutputModule(), Config.Process._placePath(), Config.Process._placeProducer(), Config.Process._placePSet(), Config.Process._placeSequence(), Config.Process._placeService(), Config.Process._placeSwitchProducer(), Config.Process._placeTask(), Config.Process._placeVPSet(), and Config.Process.setPartialSchedule_().

638  def _place(self, name, mod, d):
639  if self._okToPlace(name, mod, d):
640  if self.__isStrict and isinstance(mod, _ModuleSequenceType):
641  d[name] = mod._postProcessFixup(self._cloneToObjectDict)
642  else:
643  d[name] = mod
644  if isinstance(mod,_Labelable):
self.__setObjectLabel(mod, name)
def __setObjectLabel
Definition: Config.py:367
def _okToPlace
Definition: Config.py:616
def Config.Process._placeAccelerator (   self,
  typeName,
  mod 
)
private

Definition at line 717 of file Config.py.

References Config.Process._place().

718  def _placeAccelerator(self,typeName,mod):
719  self._place(typeName, mod, self.__accelerators)
self.__dict__[typeName]=mod
def _placeAccelerator
Definition: Config.py:717
def Config.Process._placeAlias (   self,
  name,
  mod 
)
private

Definition at line 688 of file Config.py.

References Config.Process._place().

689  def _placeAlias(self,name,mod):
self._place(name, mod, self.__aliases)
def _placeAlias
Definition: Config.py:688
def Config.Process._placeAnalyzer (   self,
  name,
  mod 
)
private

Definition at line 653 of file Config.py.

References Config.Process._place().

654  def _placeAnalyzer(self,name,mod):
self._place(name, mod, self.__analyzers)
def _placeAnalyzer
Definition: Config.py:653
def Config.Process._placeEndPath (   self,
  name,
  mod 
)
private

Definition at line 662 of file Config.py.

References Config.Process._place(), Config.Process._validateSequence(), and ExceptionHandling.format_outerframe().

663  def _placeEndPath(self,name,mod):
664  self._validateSequence(mod, name)
665  try:
666  self._place(name, mod, self.__endpaths)
667  except ModuleCloneError as msg:
668  context = format_outerframe(4)
raise Exception("%sThe module %s in endpath %s is unknown to the process %s." %(context, msg, name, self._Process__name))
def _validateSequence
Definition: Config.py:910
def _placeEndPath
Definition: Config.py:662
def Config.Process._placeESPrefer (   self,
  name,
  mod 
)
private

Definition at line 681 of file Config.py.

References Config.Process._place().

682  def _placeESPrefer(self,name,mod):
self._place(name, mod, self.__esprefers)
def _placeESPrefer
Definition: Config.py:681
def Config.Process._placeESProducer (   self,
  name,
  mod 
)
private

Definition at line 679 of file Config.py.

References Config.Process._place().

680  def _placeESProducer(self,name,mod):
self._place(name, mod, self.__esproducers)
def _placeESProducer
Definition: Config.py:679
def Config.Process._placeESSource (   self,
  name,
  mod 
)
private

Definition at line 683 of file Config.py.

References Config.Process._place().

684  def _placeESSource(self,name,mod):
self._place(name, mod, self.__essources)
def _placeESSource
Definition: Config.py:683
def Config.Process._placeFilter (   self,
  name,
  mod 
)
private

Definition at line 651 of file Config.py.

References Config.Process._place().

652  def _placeFilter(self,name,mod):
self._place(name, mod, self.__filters)
def _placeFilter
Definition: Config.py:651
def Config.Process._placeFinalPath (   self,
  name,
  mod 
)
private

Definition at line 669 of file Config.py.

References Config.Process._place(), Config.Process._validateSequence(), and ExceptionHandling.format_outerframe().

670  def _placeFinalPath(self,name,mod):
671  self._validateSequence(mod, name)
672  try:
673  self._place(name, mod, self.__finalpaths)
674  except ModuleCloneError as msg:
675  context = format_outerframe(4)
raise Exception("%sThe module %s in finalpath %s is unknown to the process %s." %(context, msg, name, self._Process__name))
def _validateSequence
Definition: Config.py:910
def _placeFinalPath
Definition: Config.py:669
def Config.Process._placeLooper (   self,
  name,
  mod 
)
private

Definition at line 702 of file Config.py.

Referenced by Config.Process.setLooper_().

703  def _placeLooper(self,name,mod):
704  if name != 'looper':
705  raise ValueError("The label '"+name+"' can not be used for a Looper. Only 'looper' is allowed.")
706  self.__dict__['_Process__looper'] = mod
self.__dict__[mod.type_()] = mod
def _placeLooper
Definition: Config.py:702
def Config.Process._placeOutputModule (   self,
  name,
  mod 
)
private

Definition at line 645 of file Config.py.

References Config.Process._place().

646  def _placeOutputModule(self,name,mod):
self._place(name, mod, self.__outputmodules)
def _placeOutputModule
Definition: Config.py:645
def Config.Process._placePath (   self,
  name,
  mod 
)
private

Definition at line 655 of file Config.py.

References Config.Process._place(), Config.Process._validateSequence(), and ExceptionHandling.format_outerframe().

656  def _placePath(self,name,mod):
657  self._validateSequence(mod, name)
658  try:
659  self._place(name, mod, self.__paths)
660  except ModuleCloneError as msg:
661  context = format_outerframe(4)
raise Exception("%sThe module %s in path %s is unknown to the process %s." %(context, msg, name, self._Process__name))
def _validateSequence
Definition: Config.py:910
def _placePath
Definition: Config.py:655
def Config.Process._placeProducer (   self,
  name,
  mod 
)
private

Definition at line 647 of file Config.py.

References Config.Process._place().

648  def _placeProducer(self,name,mod):
self._place(name, mod, self.__producers)
def _placeProducer
Definition: Config.py:647
def Config.Process._placePSet (   self,
  name,
  mod 
)
private

Definition at line 690 of file Config.py.

References Config.Process._place().

691  def _placePSet(self,name,mod):
self._place(name, mod, self.__psets)
def _placePSet
Definition: Config.py:690
def Config.Process._placeSequence (   self,
  name,
  mod 
)
private

Definition at line 676 of file Config.py.

References Config.Process._place(), and Config.Process._validateSequence().

677  def _placeSequence(self,name,mod):
678  self._validateSequence(mod, name)
self._place(name, mod, self.__sequences)
def _validateSequence
Definition: Config.py:910
def _placeSequence
Definition: Config.py:676
def Config.Process._placeService (   self,
  typeName,
  mod 
)
private

Definition at line 712 of file Config.py.

References Config.Process._place().

713  def _placeService(self,typeName,mod):
714  self._place(typeName, mod, self.__services)
715  if typeName in self.__dict__:
716  self.__dict__[typeName]._inProcess = False
self.__dict__[typeName]=mod
def _placeService
Definition: Config.py:712
def Config.Process._placeSource (   self,
  name,
  mod 
)
private
Allow the source to be referenced by 'source' or by type name

Definition at line 694 of file Config.py.

Referenced by Config.Process.setSource_().

695  def _placeSource(self,name,mod):
696  """Allow the source to be referenced by 'source' or by type name"""
697  if name != 'source':
698  raise ValueError("The label '"+name+"' can not be used for a Source. Only 'source' is allowed.")
699  if self.__dict__['_Process__source'] is not None :
700  del self.__dict__[self.__dict__['_Process__source'].type_()]
701  self.__dict__['_Process__source'] = mod
self.__dict__[mod.type_()] = mod
def _placeSource
Definition: Config.py:694
def Config.Process._placeSubProcess (   self,
  name,
  mod 
)
private

Definition at line 707 of file Config.py.

708  def _placeSubProcess(self,name,mod):
709  self.__dict__['_Process__subProcess'] = mod
self.__dict__[mod.type_()] = mod
def _placeSubProcess
Definition: Config.py:707
def Config.Process._placeSwitchProducer (   self,
  name,
  mod 
)
private

Definition at line 649 of file Config.py.

References Config.Process._place().

650  def _placeSwitchProducer(self,name,mod):
self._place(name, mod, self.__switchproducers)
def _placeSwitchProducer
Definition: Config.py:649
def Config.Process._placeTask (   self,
  name,
  task 
)
private

Definition at line 685 of file Config.py.

References Config.Process._place(), and Config.Process._validateTask().

686  def _placeTask(self,name,task):
687  self._validateTask(task, name)
self._place(name, task, self.__tasks)
def _validateTask
Definition: Config.py:919
def _placeTask
Definition: Config.py:685
def Config.Process._placeVPSet (   self,
  name,
  mod 
)
private

Definition at line 692 of file Config.py.

References Config.Process._place().

693  def _placeVPSet(self,name,mod):
self._place(name, mod, self.__vpsets)
def _placeVPSet
Definition: Config.py:692
def Config.Process._pruneModules (   self,
  d,
  scheduledNames 
)
private

Definition at line 1352 of file Config.py.

Referenced by Config.Process.prune().

1353  def _pruneModules(self, d, scheduledNames):
1354  moduleNames = set(d.keys())
1355  junk = moduleNames - scheduledNames
1356  for name in junk:
1357  delattr(self, name)
1358  return junk
def _pruneModules
Definition: Config.py:1352
def Config.Process._replaceInSchedule (   self,
  label,
  new 
)
private

Definition at line 1125 of file Config.py.

References EcalDQMonitorTask.schedule_, edm::ModuleChanger.schedule_, edm::ScheduleInfo.schedule_, edm::PathsAndConsumesOfModules.schedule_, edm::SubProcess.schedule_, Config.Process.schedule_(), edm::EventProcessor.schedule_, and edm::test::TestProcessor.schedule_.

Referenced by Config.Process.__delattr__(), and Config.Process.__setattr__().

1126  def _replaceInSchedule(self, label, new):
1127  if self.schedule_() == None:
1128  return
1129  old = getattr(self,label)
1130  for task in self.schedule_()._tasks:
task.replace(old, new)
def _replaceInSchedule
Definition: Config.py:1125
def schedule_
Definition: Config.py:307
def Config.Process._replaceInScheduleDirectly (   self,
  label,
  new 
)
private

Definition at line 1131 of file Config.py.

References EcalDQMonitorTask.schedule_, edm::ModuleChanger.schedule_, edm::ScheduleInfo.schedule_, edm::PathsAndConsumesOfModules.schedule_, edm::SubProcess.schedule_, Config.Process.schedule_(), edm::EventProcessor.schedule_, and edm::test::TestProcessor.schedule_.

Referenced by Config.Process.__delattr__(), and Config.Process.__setattr__().

1132  def _replaceInScheduleDirectly(self, label, new):
1133  if self.schedule_() == None:
1134  return
1135  old = getattr(self,label)
self.schedule_()._replaceIfHeldDirectly(old, new)
def _replaceInScheduleDirectly
Definition: Config.py:1131
def schedule_
Definition: Config.py:307
def Config.Process._replaceInSequences (   self,
  label,
  new 
)
private

Definition at line 1104 of file Config.py.

Referenced by Config.Process.__delattr__(), and Config.Process.__setattr__().

1105  def _replaceInSequences(self, label, new):
1106  old = getattr(self,label)
1107  #TODO - replace by iterator concatenation
1108  #to ovoid dependency problems between sequences, first modify
1109  # process known sequences to do a non-recursive change. Then do
1110  # a recursive change to get cases where a sub-sequence unknown to
1111  # the process has the item to be replaced
1112  for sequenceable in self.sequences.values():
1113  sequenceable._replaceIfHeldDirectly(old,new)
1114  for sequenceable in self.sequences.values():
1115  sequenceable.replace(old,new)
1116  for sequenceable in self.paths.values():
1117  sequenceable.replace(old,new)
1118  for sequenceable in self.endpaths.values():
1119  sequenceable.replace(old,new)
1120  for sequenceable in self.finalpaths.values():
sequenceable.replace(old,new)
def _replaceInSequences
Definition: Config.py:1104
def Config.Process._replaceInTasks (   self,
  label,
  new 
)
private

Definition at line 1121 of file Config.py.

Referenced by Config.Process.__delattr__(), and Config.Process.__setattr__().

1122  def _replaceInTasks(self, label, new):
1123  old = getattr(self,label)
1124  for task in self.tasks.values():
task.replace(old, new)
def _replaceInTasks
Definition: Config.py:1121
def Config.Process._splitPython (   self,
  subfolder,
  d,
  options 
)
private

Definition at line 991 of file Config.py.

Referenced by Config.Process.splitPython().

992  def _splitPython(self, subfolder, d, options):
993  result = {}
994  for name, value in sorted(d.items()):
995  result[name] = subfolder, value.dumpPythonAs(name, options) + '\n'
996  return result
def _splitPython
Definition: Config.py:991
def Config.Process._splitPythonList (   self,
  subfolder,
  d,
  options 
)
private

Definition at line 889 of file Config.py.

Referenced by Config.Process.splitPython().

890  def _splitPythonList(self, subfolder, d, options):
891  parts = DictTypes.SortedKeysDict()
892  for name, item in d.items() if isinstance(d, DictTypes.SortedKeysDict) else sorted(d.items()):
893  code = ''
894  dependencies = item.directDependencies()
895  for module_subfolder, module in dependencies:
896  module = module + '_cfi'
897  if options.useSubdirectories and module_subfolder:
898  module = module_subfolder + '.' + module
899  if options.targetDirectory is not None:
900  if options.useSubdirectories and subfolder:
901  module = '..' + module
902  else:
903  module = '.' + module
904  code += 'from ' + module + ' import *\n'
905  if dependencies:
906  code += '\n'
907  code += name + ' = ' + item.dumpPython(options)
908  parts[name] = subfolder, code
909  return parts
def _splitPythonList
Definition: Config.py:889
def Config.Process._validateSequence (   self,
  sequence,
  label 
)
private

Definition at line 910 of file Config.py.

Referenced by Config.Process._placeEndPath(), Config.Process._placeFinalPath(), Config.Process._placePath(), and Config.Process._placeSequence().

911  def _validateSequence(self, sequence, label):
912  # See if every module has been inserted into the process
913  try:
914  l = set()
915  visitor = NodeNameVisitor(l)
916  sequence.visit(visitor)
917  except:
918  raise RuntimeError("An entry in sequence "+label + ' has no label')
def _validateSequence
Definition: Config.py:910
def Config.Process._validateTask (   self,
  task,
  label 
)
private

Definition at line 919 of file Config.py.

Referenced by Config.Process._placeTask().

920  def _validateTask(self, task, label):
921  # See if every module and service has been inserted into the process
922  try:
923  l = set()
924  visitor = NodeNameVisitor(l)
925  task.visit(visitor)
926  except:
927  raise RuntimeError("An entry in task " + label + ' has not been attached to the process')
def _validateTask
Definition: Config.py:919
def Config.Process.add_ (   self,
  value 
)
Allows addition of components that do not have to have a label, e.g. Services

Definition at line 601 of file Config.py.

References Config.Process.__isStrict.

Referenced by Config.Process.__setattr__(), and Config.Process.extend().

602  def add_(self,value):
603  """Allows addition of components that do not have to have a label, e.g. Services"""
604  if not isinstance(value,_ConfigureComponent):
605  raise TypeError
606  if not isinstance(value,_Unlabelable):
607  raise TypeError
608  #clone the item
609  #clone the item
610  if self.__isStrict:
611  newValue =value.copy()
612  value.setIsFrozen()
613  else:
614  newValue =value
615  newValue._place('',self)
def Config.Process.addSubProcess (   self,
  mod 
)

Definition at line 710 of file Config.py.

711  def addSubProcess(self,mod):
self.__subProcesses.append(mod)
def addSubProcess
Definition: Config.py:710
def Config.Process.aliases_ (   self)
returns a dict of the aliases that have been added to the Process

Definition at line 346 of file Config.py.

Referenced by Config.Process.dumpConfig(), Config.Process.dumpPython(), and Config.Process.splitPython().

347  def aliases_(self):
348  """returns a dict of the aliases that have been added to the Process"""
return DictTypes.FixedKeysDict(self.__aliases)
def aliases_
Definition: Config.py:346
def Config.Process.analyzerNames (   self)
Returns a string containing all the EDAnalyzer labels separated by a blank

Definition at line 162 of file Config.py.

References HLTMuonValidator.analyzers_, Config.Process.analyzers_(), join(), and relativeConstraints.keys.

163  def analyzerNames(self):
164  """Returns a string containing all the EDAnalyzer labels separated by a blank"""
return ' '.join(self.analyzers_().keys())
def analyzers_
Definition: Config.py:279
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def analyzerNames
Definition: Config.py:162
def Config.Process.analyzers_ (   self)
returns a dict of the analyzers that have been added to the Process

Definition at line 279 of file Config.py.

Referenced by Config.Process.analyzerNames(), Config.Process.dumpConfig(), Config.Process.dumpPython(), Config.Process.prune(), and Config.Process.splitPython().

280  def analyzers_(self):
281  """returns a dict of the analyzers that have been added to the Process"""
return DictTypes.FixedKeysDict(self.__analyzers)
def analyzers_
Definition: Config.py:279
def Config.Process.defaultMaxEvents_ ( )
static

Definition at line 260 of file Config.py.

Referenced by Config.Process.__updateMaxEvents().

261  def defaultMaxEvents_():
262  return untracked.PSet(input=optional.untracked.int32,
output=optional.untracked.allowed(int32,PSet))
def defaultMaxEvents_
Definition: Config.py:260
def Config.Process.defaultMaxLuminosityBlocks_ ( )
static

Definition at line 273 of file Config.py.

return untracked.PSet(input=untracked.int32(-1))
def defaultMaxLuminosityBlocks_
Definition: Config.py:273
def Config.Process.defaultOptions_ ( )
static

Definition at line 221 of file Config.py.

Referenced by Config.Process.__updateOptions().

222  def defaultOptions_():
223  return untracked.PSet(numberOfThreads = untracked.uint32(1),
224  numberOfStreams = untracked.uint32(0),
225  numberOfConcurrentRuns = untracked.uint32(1),
226  numberOfConcurrentLuminosityBlocks = untracked.uint32(0),
227  eventSetup = untracked.PSet(
228  numberOfConcurrentIOVs = untracked.uint32(0),
229  forceNumberOfConcurrentIOVs = untracked.PSet(
230  allowAnyLabel_ = required.untracked.uint32
231  )
232  ),
233  accelerators = untracked.vstring('*'),
234  wantSummary = untracked.bool(False),
235  fileMode = untracked.string('FULLMERGE'),
236  forceEventSetupCacheClearOnNewRun = untracked.bool(False),
237  throwIfIllegalParameter = untracked.bool(True),
238  printDependencies = untracked.bool(False),
239  deleteNonConsumedUnscheduledModules = untracked.bool(True),
240  sizeOfStackForThreadsInKB = optional.untracked.uint32,
241  Rethrow = untracked.vstring(),
242  SkipEvent = untracked.vstring(),
243  FailPath = untracked.vstring(),
244  IgnoreCompletely = untracked.vstring(),
245  canDeleteEarly = untracked.vstring(),
246  dumpOptions = untracked.bool(False),
247  allowUnscheduled = obsolete.untracked.bool,
248  emptyRunLumiMode = obsolete.untracked.string,
249  makeTriggerResults = obsolete.untracked.bool
)
def defaultOptions_
Definition: Config.py:221
def Config.Process.dumpConfig (   self,
  options = PrintOptions() 
)
return a string containing the equivalent process defined using the old configuration language

Definition at line 798 of file Config.py.

References dataset.Dataset.__name, genericValidation.ValidationWithPlotsSummaryBase.SummaryItem.__name, Config.Process._dumpConfigESPrefers(), Config.Process._dumpConfigNamedList(), Config.Process._dumpConfigOptionallyNamedList(), Config.Process._dumpConfigUnnamedList(), Config.Process.aliases_(), HLTMuonValidator.analyzers_, Config.Process.analyzers_(), Config.Process.endpaths_(), FastTimerService::PlotsPerProcess.endpaths_, Config.Process.es_producers_(), Config.Process.es_sources_(), pat::eventhypothesis::AndFilter.filters_, pat::eventhypothesis::OrFilter.filters_, pat::TriggerEvent.filters_, TrigObjTnPHistColl::FilterSelector::FilterSet.filters_, FilterOR.filters_, Config.Process.filters_(), cms::DDFilteredView.filters_, FilterSelection.filters_, FilterSelections.filters_, Config.Process.finalpaths_(), mps_monitormerge.items, join(), Config.Process.looper_(), edm::EventProcessor.looper_, Config.Process.outputModules_(), edm::MainParameterSet.paths_, edm::HLTGlobalStatus.paths_, heppy::TriggerBitChecker.paths_, edm::PathsAndConsumesOfModules.paths_, ProcessCallGraph::ProcessType.paths_, pat::TriggerEvent.paths_, HLTPerformanceInfo.paths_, Config.Process.paths_(), FastTimerService::PlotsPerProcess.paths_, pf2pat::EventHypothesis.producers_, Config.Process.producers_(), ConfigBuilder.ConfigBuilder.schedule, Config.Process.schedule, Config.Process.sequences_(), edm::ProcessDesc.services_, Config.Process.services_(), ecaldqm::DBWriterWorker.source_, L2MuonSeedGeneratorFromL1TkMu.source_, SiStripFedCablingBuilderFromDb.source_, jsoncollector::DataPoint.source_, sistrip::SpyEventMatcher.source_, ProcessCallGraph.source_, Config.Process.source_(), edm::InputSource::EventSourceSentry.source_, edm::InputSource::LumiSourceSentry.source_, edm::InputSource::RunSourceSentry.source_, edm::InputSource::ProcessBlockSourceSentry.source_, Config.Process.subProcesses_(), edm::SubProcess.subProcesses_, edm::EventProcessor.subProcesses_, and Config.Process.switchProducers_().

Referenced by Types.SecSource.configValue().

799  def dumpConfig(self, options=PrintOptions()):
800  """return a string containing the equivalent process defined using the old configuration language"""
801  config = "process "+self.__name+" = {\n"
802  options.indent()
803  if self.source_():
804  config += options.indentation()+"source = "+self.source_().dumpConfig(options)
805  if self.looper_():
806  config += options.indentation()+"looper = "+self.looper_().dumpConfig(options)
807 
808  config+=self._dumpConfigNamedList(self.subProcesses_(),
809  'subProcess',
810  options)
811  config+=self._dumpConfigNamedList(self.producers_().items(),
812  'module',
813  options)
814  config+=self._dumpConfigNamedList(self.switchProducers_().items(),
815  'module',
816  options)
817  config+=self._dumpConfigNamedList(self.filters_().items(),
818  'module',
819  options)
820  config+=self._dumpConfigNamedList(self.analyzers_().items(),
821  'module',
822  options)
823  config+=self._dumpConfigNamedList(self.outputModules_().items(),
824  'module',
825  options)
826  config+=self._dumpConfigNamedList(self.sequences_().items(),
827  'sequence',
828  options)
829  config+=self._dumpConfigNamedList(self.paths_().items(),
830  'path',
831  options)
832  config+=self._dumpConfigNamedList(self.endpaths_().items(),
833  'endpath',
834  options)
835  config+=self._dumpConfigNamedList(self.finalpaths_().items(),
836  'finalpath',
837  options)
838  config+=self._dumpConfigUnnamedList(self.services_().items(),
839  'service',
840  options)
841  config+=self._dumpConfigNamedList(self.aliases_().items(),
842  'alias',
843  options)
844  config+=self._dumpConfigOptionallyNamedList(
845  self.es_producers_().items(),
846  'es_module',
847  options)
848  config+=self._dumpConfigOptionallyNamedList(
849  self.es_sources_().items(),
850  'es_source',
851  options)
852  config += self._dumpConfigESPrefers(options)
853  for name,item in self.psets.items():
854  config +=options.indentation()+item.configTypeName()+' '+name+' = '+item.configValue(options)
855  for name,item in self.vpsets.items():
856  config +=options.indentation()+'VPSet '+name+' = '+item.configValue(options)
857  if self.schedule:
858  pathNames = [p.label_() for p in self.schedule]
859  config +=options.indentation()+'schedule = {'+','.join(pathNames)+'}\n'
860 
861 # config+=self._dumpConfigNamedList(self.vpsets.items(),
862 # 'VPSet',
863 # options)
864  config += "}\n"
865  options.unindent()
866  return config
def es_sources_
Definition: Config.py:338
def _dumpConfigUnnamedList
Definition: Config.py:784
def es_producers_
Definition: Config.py:334
def aliases_
Definition: Config.py:346
def _dumpConfigESPrefers
Definition: Config.py:867
def _dumpConfigOptionallyNamedList
Definition: Config.py:790
def filters_
Definition: Config.py:189
def outputModules_
Definition: Config.py:283
def producers_
Definition: Config.py:200
def analyzers_
Definition: Config.py:279
def switchProducers_
Definition: Config.py:204
def dumpConfig
Definition: Config.py:798
def services_
Definition: Config.py:326
def sequences_
Definition: Config.py:299
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def _dumpConfigNamedList
Definition: Config.py:778
def finalpaths_
Definition: Config.py:295
def subProcesses_
Definition: Config.py:275
def endpaths_
Definition: Config.py:291
def Config.Process.dumpPython (   self,
  options = PrintOptions() 
)
return a string containing the equivalent process defined using python

Definition at line 997 of file Config.py.

References dataset.Dataset.__name, genericValidation.ValidationWithPlotsSummaryBase.SummaryItem.__name, Config.Process._dumpPython(), Config.Process._dumpPythonList(), Config.Process._dumpPythonSubProcesses(), Config.Process._itemsInDependencyOrder(), Config.Process.aliases_(), HLTMuonValidator.analyzers_, Config.Process.analyzers_(), Config.Process.endpaths_(), FastTimerService::PlotsPerProcess.endpaths_, Config.Process.es_prefers_(), Config.Process.es_producers_(), Config.Process.es_sources_(), pat::eventhypothesis::AndFilter.filters_, pat::eventhypothesis::OrFilter.filters_, pat::TriggerEvent.filters_, TrigObjTnPHistColl::FilterSelector::FilterSet.filters_, FilterOR.filters_, Config.Process.filters_(), cms::DDFilteredView.filters_, FilterSelection.filters_, FilterSelections.filters_, Config.Process.finalpaths_(), join(), Config.Process.looper_(), edm::EventProcessor.looper_, Config.Process.outputModules_(), edm::MainParameterSet.paths_, edm::HLTGlobalStatus.paths_, heppy::TriggerBitChecker.paths_, edm::PathsAndConsumesOfModules.paths_, ProcessCallGraph::ProcessType.paths_, pat::TriggerEvent.paths_, HLTPerformanceInfo.paths_, Config.Process.paths_(), FastTimerService::PlotsPerProcess.paths_, Config.Process.processAccelerators_(), pf2pat::EventHypothesis.producers_, Config.Process.producers_(), Config.Process.psets, EcalDQMonitorTask.schedule_, edm::ModuleChanger.schedule_, edm::ScheduleInfo.schedule_, edm::PathsAndConsumesOfModules.schedule_, edm::SubProcess.schedule_, Config.Process.schedule_(), edm::EventProcessor.schedule_, edm::test::TestProcessor.schedule_, Config.Process.sequences, edm::ProcessDesc.services_, Config.Process.services_(), ecaldqm::DBWriterWorker.source_, L2MuonSeedGeneratorFromL1TkMu.source_, SiStripFedCablingBuilderFromDb.source_, jsoncollector::DataPoint.source_, sistrip::SpyEventMatcher.source_, ProcessCallGraph.source_, Config.Process.source_(), edm::InputSource::EventSourceSentry.source_, edm::InputSource::LumiSourceSentry.source_, edm::InputSource::RunSourceSentry.source_, edm::InputSource::ProcessBlockSourceSentry.source_, Config.Process.subProcesses_(), edm::SubProcess.subProcesses_, edm::EventProcessor.subProcesses_, Config.Process.switchProducers_(), Config.Process.tasks, and Config.Process.vpsets.

Referenced by Modules.SwitchProducer.__addParameter(), Types._AllowedParameterTypes.__init__(), Mixins._ParameterTypeBase.__repr__(), Mixins._Parameterizable.__repr__(), Mixins._ValidatingParameterListBase.__repr__(), Types.VPSet.__repr__(), Mixins._Parameterizable.__setattr__(), Modules.SwitchProducer.__setattr__(), SequenceTypes.Schedule.__str__(), and Config.Process.splitPython().

998  def dumpPython(self, options=PrintOptions()):
999  """return a string containing the equivalent process defined using python"""
1000  specialImportRegistry._reset()
1001  header = "import FWCore.ParameterSet.Config as cms"
1002  result = "process = cms.Process(\""+self.__name+"\")\n\n"
1003  if self.source_():
1004  result += "process.source = "+self.source_().dumpPython(options)
1005  if self.looper_():
1006  result += "process.looper = "+self.looper_().dumpPython()
1007  result+=self._dumpPythonList(self.psets, options)
1008  result+=self._dumpPythonList(self.vpsets, options)
1009  result+=self._dumpPythonSubProcesses(self.subProcesses_(), options)
1010  result+=self._dumpPythonList(self.producers_(), options)
1011  result+=self._dumpPythonList(self.switchProducers_(), options)
1012  result+=self._dumpPythonList(self.filters_() , options)
1013  result+=self._dumpPythonList(self.analyzers_(), options)
1014  result+=self._dumpPythonList(self.outputModules_(), options)
1015  result+=self._dumpPythonList(self.services_(), options)
1016  result+=self._dumpPythonList(self.processAccelerators_(), options)
1017  result+=self._dumpPythonList(self.es_producers_(), options)
1018  result+=self._dumpPythonList(self.es_sources_(), options)
1019  result+=self._dumpPython(self.es_prefers_(), options)
1020  result+=self._dumpPythonList(self._itemsInDependencyOrder(self.tasks), options)
1021  result+=self._dumpPythonList(self._itemsInDependencyOrder(self.sequences), options)
1022  result+=self._dumpPythonList(self.paths_(), options)
1023  result+=self._dumpPythonList(self.endpaths_(), options)
1024  result+=self._dumpPythonList(self.finalpaths_(), options)
1025  result+=self._dumpPythonList(self.aliases_(), options)
1026  if not self.schedule_() == None:
1027  result += 'process.schedule = ' + self.schedule.dumpPython(options)
1028  imports = specialImportRegistry.getSpecialImports()
1029  if len(imports) > 0:
1030  header += "\n" + "\n".join(imports)
1031  header += "\n\n"
1032  return header+result
def es_sources_
Definition: Config.py:338
def _itemsInDependencyOrder
Definition: Config.py:928
def es_producers_
Definition: Config.py:334
def aliases_
Definition: Config.py:346
def filters_
Definition: Config.py:189
def dumpPython
Definition: Config.py:997
def es_prefers_
Definition: Config.py:342
def _dumpPythonSubProcesses
Definition: Config.py:873
def outputModules_
Definition: Config.py:283
def producers_
Definition: Config.py:200
def analyzers_
Definition: Config.py:279
def switchProducers_
Definition: Config.py:204
def processAccelerators_
Definition: Config.py:330
def services_
Definition: Config.py:326
def schedule_
Definition: Config.py:307
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def _dumpPythonList
Definition: Config.py:879
def finalpaths_
Definition: Config.py:295
def subProcesses_
Definition: Config.py:275
def _dumpPython
Definition: Config.py:985
def endpaths_
Definition: Config.py:291
def Config.Process.endpaths_ (   self)
returns a dict of the endpaths that have been added to the Process

Definition at line 291 of file Config.py.

Referenced by Config.Process._insertPaths(), Config.Process.dumpConfig(), Config.Process.dumpPython(), and Config.Process.splitPython().

292  def endpaths_(self):
293  """returns a dict of the endpaths that have been added to the Process"""
return DictTypes.SortedAndFixedKeysDict(self.__endpaths)
def endpaths_
Definition: Config.py:291
def Config.Process.es_prefers_ (   self)
returns a dict of the es_prefers that have been added to the Process

Definition at line 342 of file Config.py.

Referenced by Config.Process._dumpConfigESPrefers(), Config.Process.dumpPython(), and Config.Process.splitPython().

343  def es_prefers_(self):
344  """returns a dict of the es_prefers that have been added to the Process"""
return DictTypes.FixedKeysDict(self.__esprefers)
def es_prefers_
Definition: Config.py:342
def Config.Process.es_producers_ (   self)
returns a dict of the esproducers that have been added to the Process

Definition at line 334 of file Config.py.

Referenced by Config.Process.dumpConfig(), Config.Process.dumpPython(), Config.Process.prefer(), and Config.Process.splitPython().

335  def es_producers_(self):
336  """returns a dict of the esproducers that have been added to the Process"""
return DictTypes.FixedKeysDict(self.__esproducers)
def es_producers_
Definition: Config.py:334
def Config.Process.es_sources_ (   self)
returns a the es_sources that have been added to the Process

Definition at line 338 of file Config.py.

Referenced by Config.Process.dumpConfig(), Config.Process.dumpPython(), Config.Process.prefer(), and Config.Process.splitPython().

339  def es_sources_(self):
340  """returns a the es_sources that have been added to the Process"""
return DictTypes.FixedKeysDict(self.__essources)
def es_sources_
Definition: Config.py:338
def Config.Process.extend (   self,
  other,
  items = () 
)
Look in other and find types that we can use

Definition at line 724 of file Config.py.

References psClasses.BuildTreeNode.__setattr__(), Config.Process.__setattr__(), Config.FilteredStream.__setattr__, Config.Process.__setObjectLabel(), Config.Process.add_(), DeadROC_duringRun.dir, SiStripCluster.extend(), svgfig.SVG.extend(), Config.Process.extend(), and gpuClustering.id.

Referenced by MatrixUtil.WF.__init__(), Config.Process.extend(), Config.Process.load(), and Mixins._ValidatingParameterListBase.setValue().

725  def extend(self,other,items=()):
726  """Look in other and find types that we can use"""
727  # enable explicit check to avoid overwriting of existing objects
728  self.__dict__['_Process__InExtendCall'] = True
729 
730  seqs = dict()
731  tasksToAttach = dict()
732  mods = []
733  for name in dir(other):
734  #'from XX import *' ignores these, and so should we.
735  if name.startswith('_'):
736  continue
737  item = getattr(other,name)
738  if name == "source" or name == "looper":
739  # In these cases 'item' could be None if the specific object was not defined
740  if item is not None:
741  self.__setattr__(name,item)
742  elif isinstance(item,_ModuleSequenceType):
743  seqs[name]=item
744  elif isinstance(item,Task):
745  tasksToAttach[name] = item
746  elif isinstance(item,_Labelable):
747  self.__setattr__(name,item)
748  if not item.hasLabel_() :
749  item.setLabel(name)
750  elif isinstance(item,Schedule):
751  self.__setattr__(name,item)
752  elif isinstance(item,_Unlabelable):
753  self.add_(item)
754  elif isinstance(item,ProcessModifier):
755  mods.append(item)
756  elif isinstance(item,ProcessFragment):
757  self.extend(item)
758 
759  #now create a sequence that uses the newly made items
760  for name,seq in seqs.items():
761  if id(seq) not in self._cloneToObjectDict:
762  self.__setattr__(name,seq)
763  else:
764  newSeq = self._cloneToObjectDict[id(seq)]
765  self.__dict__[name]=newSeq
766  self.__setObjectLabel(newSeq, name)
767  #now put in proper bucket
768  newSeq._place(name,self)
769 
770  for name, task in tasksToAttach.items():
771  self.__setattr__(name, task)
772 
773  #apply modifiers now that all names have been added
774  for item in mods:
775  item.apply(self)
776 
777  self.__dict__['_Process__InExtendCall'] = False
def __setObjectLabel
Definition: Config.py:367
uint16_t *__restrict__ id
def __setattr__
Definition: Config.py:394
def Config.Process.fillProcessDesc (   self,
  processPSet 
)
Used by the framework to convert python to C++ objects

Definition at line 1359 of file Config.py.

References Config.Process.__init__().

1360  def fillProcessDesc(self, processPSet):
1361  """Used by the framework to convert python to C++ objects"""
1362  class ServiceInjectorAdaptor(object):
1363  def __init__(self,ppset,thelist):
1364  self.__thelist = thelist
1365  self.__processPSet = ppset
1366  def addService(self,pset):
1367  self.__thelist.append(pset)
1368  def newPSet(self):
1369  return self.__processPSet.newPSet()
1370  #This adaptor is used to 'add' the method 'getTopPSet_'
1371  # to the ProcessDesc and PythonParameterSet C++ classes.
1372  # This method is needed for the PSet refToPSet_ functionality.
1373  class TopLevelPSetAcessorAdaptor(object):
1374  def __init__(self,ppset,process):
1375  self.__ppset = ppset
1376  self.__process = process
1377  def __getattr__(self,attr):
1378  return getattr(self.__ppset,attr)
1379  def getTopPSet_(self,label):
1380  return getattr(self.__process,label)
1381  def newPSet(self):
1382  return TopLevelPSetAcessorAdaptor(self.__ppset.newPSet(),self.__process)
1383  def addPSet(self,tracked,name,ppset):
1384  return self.__ppset.addPSet(tracked,name,self.__extractPSet(ppset))
1385  def addVPSet(self,tracked,name,vpset):
1386  return self.__ppset.addVPSet(tracked,name,[self.__extractPSet(x) for x in vpset])
1387  def __extractPSet(self,pset):
1388  if isinstance(pset,TopLevelPSetAcessorAdaptor):
1389  return pset.__ppset
1390  return pset
1391 
1392  self.validate()
1393  processPSet.addString(True, "@process_name", self.name_())
1394  self.handleProcessAccelerators(processPSet)
1395  all_modules = self.producers_().copy()
1396  all_modules.update(self.filters_())
1397  all_modules.update(self.analyzers_())
1398  all_modules.update(self.outputModules_())
1399  adaptor = TopLevelPSetAcessorAdaptor(processPSet,self)
1400  self._insertInto(adaptor, self.psets_())
1401  self._insertInto(adaptor, self.vpsets_())
1402  self._insertOneInto(adaptor, "@all_sources", self.source_(), True)
1403  self._insertOneInto(adaptor, "@all_loopers", self.looper_(), True)
1404  self._insertSubProcessesInto(adaptor, "@all_subprocesses", self.subProcesses_(), False)
1405  self._insertManyInto(adaptor, "@all_esprefers", self.es_prefers_(), True)
1406  self._insertManyInto(adaptor, "@all_aliases", self.aliases_(), True)
1407  # This will visit all the paths and endpaths that are scheduled to run,
1408  # as well as the Tasks associated to them and the schedule. It remembers
1409  # the modules, ESSources, ESProducers, and services it visits.
1410  nodeVisitor = NodeVisitor()
1411  self._insertPaths(adaptor, nodeVisitor)
1412  all_modules_onTasksOrScheduled = { key:value for key, value in all_modules.items() if value in nodeVisitor.modules }
1413  self._insertManyInto(adaptor, "@all_modules", all_modules_onTasksOrScheduled, True)
1414  all_switches = self.switchProducers_().copy()
1415  all_switches_onTasksOrScheduled = {key:value for key, value in all_switches.items() if value in nodeVisitor.modules }
1416  self._insertSwitchProducersInto(adaptor, "@all_modules", "@all_aliases", all_switches_onTasksOrScheduled, True)
1417  # Same as nodeVisitor except this one visits all the Tasks attached
1418  # to the process.
1419  processNodeVisitor = NodeVisitor()
1420  for pTask in self.tasks.values():
1421  pTask.visit(processNodeVisitor)
1422  esProducersToEnable = {}
1423  for esProducerName, esProducer in self.es_producers_().items():
1424  if esProducer in nodeVisitor.esProducers or not (esProducer in processNodeVisitor.esProducers):
1425  esProducersToEnable[esProducerName] = esProducer
1426  self._insertManyInto(adaptor, "@all_esmodules", esProducersToEnable, True)
1427  esSourcesToEnable = {}
1428  for esSourceName, esSource in self.es_sources_().items():
1429  if esSource in nodeVisitor.esSources or not (esSource in processNodeVisitor.esSources):
1430  esSourcesToEnable[esSourceName] = esSource
1431  self._insertManyInto(adaptor, "@all_essources", esSourcesToEnable, True)
1432  #handle services differently
1433  services = []
1434  for serviceName, serviceObject in self.services_().items():
1435  if serviceObject in nodeVisitor.services or not (serviceObject in processNodeVisitor.services):
1436  serviceObject.insertInto(ServiceInjectorAdaptor(adaptor,services))
1437  adaptor.addVPSet(False,"services",services)
1438  return processPSet
def es_sources_
Definition: Config.py:338
def _insertManyInto
Definition: Config.py:1151
def es_producers_
Definition: Config.py:334
def aliases_
Definition: Config.py:346
def filters_
Definition: Config.py:189
def es_prefers_
Definition: Config.py:342
def _insertPaths
Definition: Config.py:1183
def addService
Definition: FastTimer.py:3
def _insertSubProcessesInto
Definition: Config.py:1170
def outputModules_
Definition: Config.py:283
def producers_
Definition: Config.py:200
def fillProcessDesc
Definition: Config.py:1359
def __init__
Definition: Config.py:104
def _insertInto
Definition: Config.py:1141
def analyzers_
Definition: Config.py:279
def switchProducers_
Definition: Config.py:204
def services_
Definition: Config.py:326
def _insertSwitchProducersInto
Definition: Config.py:1159
def _insertOneInto
Definition: Config.py:1144
def handleProcessAccelerators
Definition: Config.py:1446
def subProcesses_
Definition: Config.py:275
def Config.Process.filterNames (   self)
Returns a string containing all the EDFilter labels separated by a blank

Definition at line 165 of file Config.py.

References pat::eventhypothesis::AndFilter.filters_, pat::eventhypothesis::OrFilter.filters_, pat::TriggerEvent.filters_, TrigObjTnPHistColl::FilterSelector::FilterSet.filters_, FilterOR.filters_, Config.Process.filters_(), cms::DDFilteredView.filters_, FilterSelection.filters_, FilterSelections.filters_, join(), and relativeConstraints.keys.

166  def filterNames(self):
167  """Returns a string containing all the EDFilter labels separated by a blank"""
return ' '.join(self.filters_().keys())
def filterNames
Definition: Config.py:165
def filters_
Definition: Config.py:189
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def Config.Process.filters_ (   self)
returns a dict of the filters that have been added to the Process

Definition at line 189 of file Config.py.

Referenced by Config.Process.dumpConfig(), Config.Process.dumpPython(), Config.Process.filterNames(), Config.Process.prune(), and Config.Process.splitPython().

190  def filters_(self):
191  """returns a dict of the filters that have been added to the Process"""
return DictTypes.FixedKeysDict(self.__filters)
def filters_
Definition: Config.py:189
def Config.Process.finalpaths_ (   self)
returns a dict of the finalpaths that have been added to the Process

Definition at line 295 of file Config.py.

Referenced by Config.Process._insertPaths(), Config.Process.dumpConfig(), Config.Process.dumpPython(), and Config.Process.splitPython().

296  def finalpaths_(self):
297  """returns a dict of the finalpaths that have been added to the Process"""
return DictTypes.SortedAndFixedKeysDict(self.__finalpaths)
def finalpaths_
Definition: Config.py:295
def Config.Process.globalReplace (   self,
  label,
  new 
)
Replace the item with label 'label' by object 'new' in the process and all sequences/paths/tasks

Definition at line 1136 of file Config.py.

1137  def globalReplace(self,label,new):
1138  """ Replace the item with label 'label' by object 'new' in the process and all sequences/paths/tasks"""
1139  if not hasattr(self,label):
1140  raise LookupError("process has no item of label "+label)
setattr(self,label,new)
def globalReplace
Definition: Config.py:1136
def Config.Process.handleProcessAccelerators (   self,
  parameterSet 
)

Definition at line 1446 of file Config.py.

1447  def handleProcessAccelerators(self, parameterSet):
1448  # 'cpu' accelerator is always implicitly there
1449  allAccelerators = set(["cpu"])
1450  availableAccelerators = set(["cpu"])
1451  for acc in self.__dict__['_Process__accelerators'].values():
1452  allAccelerators.update(acc.labels())
1453  availableAccelerators.update(acc.enabledLabels())
1454  availableAccelerators = sorted(list(availableAccelerators))
1455  parameterSet.addVString(False, "@available_accelerators", availableAccelerators)
1456 
1457  # Resolve wildcards
1458  selectedAccelerators = []
1459  if "*" in self.options.accelerators:
1460  if len(self.options.accelerators) >= 2:
1461  raise ValueError("process.options.accelerators may contain '*' only as the only element, now it has {} elements".format(len(self.options.accelerators)))
1462  selectedAccelerators = availableAccelerators
1463  else:
1464  import fnmatch
1465  resolved = set()
1466  invalid = []
1467  for pattern in self.options.accelerators:
1468  acc = [a for a in availableAccelerators if fnmatch.fnmatchcase(a, pattern)]
1469  if len(acc) == 0:
1470  if not any(fnmatch.fnmatchcase(a, pattern) for a in allAccelerators):
1471  invalid.append(pattern)
1472  else:
1473  resolved.update(acc)
1474  # Sanity check
1475  if len(invalid) != 0:
1476  raise ValueError("Invalid pattern{} of {} in process.options.accelerators, valid values are {} or a pattern matching to some of them.".format(
1477  "s" if len(invalid) > 2 else "",
1478  ",".join(invalid),
1479  ",".join(sorted(list(allAccelerators)))))
1480  selectedAccelerators = sorted(list(resolved))
1481  parameterSet.addVString(False, "@selected_accelerators", selectedAccelerators)
1482 
1483  # Customize
1484  wrapped = ProcessForProcessAccelerator(self)
1485  for acc in self.__dict__['_Process__accelerators'].values():
1486  acc.apply(wrapped, selectedAccelerators)
bool any(const std::vector< T > &v, const T &what)
Definition: ECalSD.cc:37
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def handleProcessAccelerators
Definition: Config.py:1446
def Config.Process.isUsingModifier (   self,
  mod 
)
returns True if the Modifier is in used by this Process

Definition at line 359 of file Config.py.

360  def isUsingModifier(self,mod):
361  """returns True if the Modifier is in used by this Process"""
362  if mod._isChosen():
363  for m in self.__modifiers:
364  if m._isOrContains(mod):
365  return True
366  return False
def isUsingModifier
Definition: Config.py:359
def Config.Process.load (   self,
  moduleName 
)

Definition at line 720 of file Config.py.

References SiStripCluster.extend(), svgfig.SVG.extend(), and Config.Process.extend().

721  def load(self, moduleName):
722  moduleName = moduleName.replace("/",".")
723  module = __import__(moduleName)
self.extend(sys.modules[moduleName])
def Config.Process.looper_ (   self)
returns the looper that has been added to the Process or None if none have been added

Definition at line 214 of file Config.py.

Referenced by Config.Process.dumpConfig(), Config.Process.dumpPython(), and Config.Process.splitPython().

215  def looper_(self):
216  """returns the looper that has been added to the Process or None if none have been added"""
return self.__looper
def Config.Process.name_ (   self)

Definition at line 193 of file Config.py.

References dataset.Dataset.__name, and genericValidation.ValidationWithPlotsSummaryBase.SummaryItem.__name.

194  def name_(self):
return self.__name
def Config.Process.outputModules_ (   self)
returns a dict of the output modules that have been added to the Process

Definition at line 283 of file Config.py.

Referenced by Config.Process.dumpConfig(), Config.Process.dumpPython(), and Config.Process.splitPython().

284  def outputModules_(self):
285  """returns a dict of the output modules that have been added to the Process"""
return DictTypes.FixedKeysDict(self.__outputmodules)
def outputModules_
Definition: Config.py:283
def Config.Process.pathNames (   self)
Returns a string containing all the Path names separated by a blank

Definition at line 168 of file Config.py.

References join(), relativeConstraints.keys, edm::MainParameterSet.paths_, edm::HLTGlobalStatus.paths_, heppy::TriggerBitChecker.paths_, edm::PathsAndConsumesOfModules.paths_, ProcessCallGraph::ProcessType.paths_, pat::TriggerEvent.paths_, HLTPerformanceInfo.paths_, Config.Process.paths_(), and FastTimerService::PlotsPerProcess.paths_.

169  def pathNames(self):
170  """Returns a string containing all the Path names separated by a blank"""
171  return ' '.join(self.paths_().keys())
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def pathNames
Definition: Config.py:168
def Config.Process.paths_ (   self)
returns a dict of the paths that have been added to the Process

Definition at line 287 of file Config.py.

Referenced by Config.Process._insertPaths(), Config.Process.dumpConfig(), Config.Process.dumpPython(), Config.Process.pathNames(), and Config.Process.splitPython().

288  def paths_(self):
289  """returns a dict of the paths that have been added to the Process"""
return DictTypes.SortedAndFixedKeysDict(self.__paths)
def Config.Process.prefer (   self,
  esmodule,
  args,
  kargs 
)
Prefer this ES source or producer.  The argument can
   either be an object label, e.g.,
     process.prefer(process.juicerProducer) (not supported yet)
   or a name of an ESSource or ESProducer
     process.prefer("juicer")
   or a type of unnamed ESSource or ESProducer
     process.prefer("JuicerProducer")
   In addition, you can pass as a labelled arguments the name of the Record you wish to
   prefer where the type passed is a cms.vstring and that vstring can contain the
   name of the C++ types in the Record that are being preferred, e.g.,
      #prefer all data in record 'OrangeRecord' from 'juicer'
      process.prefer("juicer", OrangeRecord=cms.vstring())
   or
      #prefer only "Orange" data in "OrangeRecord" from "juicer"
      process.prefer("juicer", OrangeRecord=cms.vstring("Orange"))
   or
      #prefer only "Orange" data with label "ExtraPulp" in "OrangeRecord" from "juicer"
      ESPrefer("ESJuicerProd", OrangeRecord=cms.vstring("Orange/ExtraPulp"))

Definition at line 1487 of file Config.py.

References Config.Process._findPreferred(), Config.Process.es_producers_(), and Config.Process.es_sources_().

1488  def prefer(self, esmodule,*args,**kargs):
1489  """Prefer this ES source or producer. The argument can
1490  either be an object label, e.g.,
1491  process.prefer(process.juicerProducer) (not supported yet)
1492  or a name of an ESSource or ESProducer
1493  process.prefer("juicer")
1494  or a type of unnamed ESSource or ESProducer
1495  process.prefer("JuicerProducer")
1496  In addition, you can pass as a labelled arguments the name of the Record you wish to
1497  prefer where the type passed is a cms.vstring and that vstring can contain the
1498  name of the C++ types in the Record that are being preferred, e.g.,
1499  #prefer all data in record 'OrangeRecord' from 'juicer'
1500  process.prefer("juicer", OrangeRecord=cms.vstring())
1501  or
1502  #prefer only "Orange" data in "OrangeRecord" from "juicer"
1503  process.prefer("juicer", OrangeRecord=cms.vstring("Orange"))
1504  or
1505  #prefer only "Orange" data with label "ExtraPulp" in "OrangeRecord" from "juicer"
1506  ESPrefer("ESJuicerProd", OrangeRecord=cms.vstring("Orange/ExtraPulp"))
1507  """
1508  # see if this refers to a named ESProducer
1509  if isinstance(esmodule, ESSource) or isinstance(esmodule, ESProducer):
1510  raise RuntimeError("Syntax of process.prefer(process.esmodule) not supported yet")
1511  elif self._findPreferred(esmodule, self.es_producers_(),*args,**kargs) or \
1512  self._findPreferred(esmodule, self.es_sources_(),*args,**kargs):
1513  pass
1514  else:
1515  raise RuntimeError("Cannot resolve prefer for "+repr(esmodule))
def es_sources_
Definition: Config.py:338
def _findPreferred
Definition: Config.py:1516
def es_producers_
Definition: Config.py:334
def Config.Process.processAccelerators_ (   self)
returns a dict of the ProcessAccelerators that have been added to the Process

Definition at line 330 of file Config.py.

Referenced by Config.Process.dumpPython().

331  def processAccelerators_(self):
332  """returns a dict of the ProcessAccelerators that have been added to the Process"""
return DictTypes.FixedKeysDict(self.__accelerators)
def processAccelerators_
Definition: Config.py:330
def Config.Process.producerNames (   self)
Returns a string containing all the EDProducer labels separated by a blank

Definition at line 156 of file Config.py.

References join(), relativeConstraints.keys, pf2pat::EventHypothesis.producers_, and Config.Process.producers_().

157  def producerNames(self):
158  """Returns a string containing all the EDProducer labels separated by a blank"""
return ' '.join(self.producers_().keys())
def producers_
Definition: Config.py:200
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def producerNames
Definition: Config.py:156
def Config.Process.producers_ (   self)
returns a dict of the producers that have been added to the Process

Definition at line 200 of file Config.py.

Referenced by Config.Process.dumpConfig(), Config.Process.dumpPython(), Config.Process.producerNames(), Config.Process.prune(), and Config.Process.splitPython().

201  def producers_(self):
202  """returns a dict of the producers that have been added to the Process"""
return DictTypes.FixedKeysDict(self.__producers)
def producers_
Definition: Config.py:200
def Config.Process.prune (   self,
  verbose = False,
  keepUnresolvedSequencePlaceholders = False 
)
Remove clutter from the process that we think is unnecessary:
tracked PSets, VPSets and unused modules and sequences. If a Schedule has been set, then Paths and EndPaths
not in the schedule will also be removed, along with an modules and sequences used only by
those removed Paths and EndPaths. The keepUnresolvedSequencePlaceholders keeps also unresolved TaskPlaceholders.

Definition at line 1281 of file Config.py.

References Config.Process._pruneModules(), HLTMuonValidator.analyzers_, Config.Process.analyzers_(), Config.Process.endpaths, pat::eventhypothesis::AndFilter.filters_, pat::eventhypothesis::OrFilter.filters_, pat::TriggerEvent.filters_, TrigObjTnPHistColl::FilterSelector::FilterSet.filters_, FilterOR.filters_, Config.Process.filters_(), cms::DDFilteredView.filters_, FilterSelection.filters_, FilterSelections.filters_, Config.Process.finalpaths, join(), Config.Process.paths, print(), pf2pat::EventHypothesis.producers_, Config.Process.producers_(), Json::Path.resolve(), Config.Process.resolve(), EcalDQMonitorTask.schedule_, edm::ModuleChanger.schedule_, edm::ScheduleInfo.schedule_, edm::PathsAndConsumesOfModules.schedule_, edm::SubProcess.schedule_, Config.Process.schedule_(), edm::EventProcessor.schedule_, edm::test::TestProcessor.schedule_, Config.Process.sequences, Config.Process.switchProducers_(), Config.Process.tasks, and Config.Process.vpsets_().

Referenced by dirstructure.Directory.prune().

1282  def prune(self,verbose=False,keepUnresolvedSequencePlaceholders=False):
1283  """ Remove clutter from the process that we think is unnecessary:
1284  tracked PSets, VPSets and unused modules and sequences. If a Schedule has been set, then Paths and EndPaths
1285  not in the schedule will also be removed, along with an modules and sequences used only by
1286  those removed Paths and EndPaths. The keepUnresolvedSequencePlaceholders keeps also unresolved TaskPlaceholders."""
1287 # need to update this to only prune psets not on refToPSets
1288 # but for now, remove the delattr
1289 # for name in self.psets_():
1290 # if getattr(self,name).isTracked():
1291 # delattr(self, name)
1292  for name in self.vpsets_():
1293  delattr(self, name)
1294  #first we need to resolve any SequencePlaceholders being used
1295  self.resolve(keepUnresolvedSequencePlaceholders)
1296  usedModules = set()
1297  unneededPaths = set()
1298  tasks = list()
1299  tv = TaskVisitor(tasks)
1300  if self.schedule_():
1301  usedModules=set(self.schedule_().moduleNames())
1302  #get rid of unused paths
1303  schedNames = set(( x.label_() for x in self.schedule_()))
1304  names = set(self.paths)
1305  names.update(set(self.endpaths))
1306  names.update(set(self.finalpaths))
1307  unneededPaths = names - schedNames
1308  for n in unneededPaths:
1309  delattr(self,n)
1310  for t in self.schedule_().tasks():
1311  tv.enter(t)
1312  t.visit(tv)
1313  tv.leave(t)
1314  else:
1315  pths = list(self.paths.values())
1316  pths.extend(self.endpaths.values())
1317  pths.extend(self.finalpaths.values())
1318  temp = Schedule(*pths)
1319  usedModules=set(temp.moduleNames())
1320  unneededModules = self._pruneModules(self.producers_(), usedModules)
1321  unneededModules.update(self._pruneModules(self.switchProducers_(), usedModules))
1322  unneededModules.update(self._pruneModules(self.filters_(), usedModules))
1323  unneededModules.update(self._pruneModules(self.analyzers_(), usedModules))
1324  #remove sequences and tasks that do not appear in remaining paths and endpaths
1325  seqs = list()
1326  sv = SequenceVisitor(seqs)
1327  for p in self.paths.values():
1328  p.visit(sv)
1329  p.visit(tv)
1330  for p in self.endpaths.values():
1331  p.visit(sv)
1332  p.visit(tv)
1333  for p in self.finalpaths.values():
1334  p.visit(sv)
1335  p.visit(tv)
1336  def removeUnneeded(seqOrTasks, allSequencesOrTasks):
1337  _keepSet = set(( s for s in seqOrTasks if s.hasLabel_()))
1338  _availableSet = set(allSequencesOrTasks.values())
1339  _unneededSet = _availableSet-_keepSet
1340  _unneededLabels = []
1341  for s in _unneededSet:
1342  _unneededLabels.append(s.label_())
1343  delattr(self,s.label_())
1344  return _unneededLabels
1345  unneededSeqLabels = removeUnneeded(seqs, self.sequences)
1346  unneededTaskLabels = removeUnneeded(tasks, self.tasks)
1347  if verbose:
1348  print("prune removed the following:")
1349  print(" modules:"+",".join(unneededModules))
1350  print(" tasks:"+",".join(unneededTaskLabels))
1351  print(" sequences:"+",".join(unneededSeqLabels))
print(" paths/endpaths/finalpaths:"+",".join(unneededPaths))
def filters_
Definition: Config.py:189
def producers_
Definition: Config.py:200
def analyzers_
Definition: Config.py:279
def switchProducers_
Definition: Config.py:204
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def schedule_
Definition: Config.py:307
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def _pruneModules
Definition: Config.py:1352
def Config.Process.psets_ (   self)
returns a dict of the PSets that have been added to the Process

Definition at line 350 of file Config.py.

351  def psets_(self):
352  """returns a dict of the PSets that have been added to the Process"""
return DictTypes.FixedKeysDict(self.__psets)
def Config.Process.resolve (   self,
  keepUnresolvedSequencePlaceholders = False 
)

Definition at line 1270 of file Config.py.

References EcalDQMonitorTask.schedule_, edm::ModuleChanger.schedule_, edm::ScheduleInfo.schedule_, edm::PathsAndConsumesOfModules.schedule_, edm::SubProcess.schedule_, Config.Process.schedule_(), edm::EventProcessor.schedule_, and edm::test::TestProcessor.schedule_.

Referenced by Config.Process.prune().

1271  def resolve(self,keepUnresolvedSequencePlaceholders=False):
1272  for x in self.paths.values():
1273  x.resolve(self.__dict__,keepUnresolvedSequencePlaceholders)
1274  for x in self.endpaths.values():
1275  x.resolve(self.__dict__,keepUnresolvedSequencePlaceholders)
1276  for x in self.finalpaths.values():
1277  x.resolve(self.__dict__,keepUnresolvedSequencePlaceholders)
1278  if not self.schedule_() == None:
1279  for task in self.schedule_()._tasks:
1280  task.resolve(self.__dict__,keepUnresolvedSequencePlaceholders)
def schedule_
Definition: Config.py:307
def Config.Process.schedule_ (   self)
returns the schedule that has been added to the Process or None if none have been added

Definition at line 307 of file Config.py.

Referenced by Config.Process._insertPaths(), Config.Process._replaceInSchedule(), Config.Process._replaceInScheduleDirectly(), Config.Process.dumpPython(), Config.Process.prune(), Config.Process.resolve(), and Config.Process.splitPython().

308  def schedule_(self):
309  """returns the schedule that has been added to the Process or None if none have been added"""
return self.__schedule
def schedule_
Definition: Config.py:307
def Config.Process.sequences_ (   self)
returns a dict of the sequences that have been added to the Process

Definition at line 299 of file Config.py.

Referenced by Config.Process.dumpConfig().

300  def sequences_(self):
301  """returns a dict of the sequences that have been added to the Process"""
return DictTypes.FixedKeysDict(self.__sequences)
def sequences_
Definition: Config.py:299
def Config.Process.services_ (   self)
returns a dict of the services that have been added to the Process

Definition at line 326 of file Config.py.

Referenced by Config.Process.dumpConfig(), Config.Process.dumpPython(), and Config.Process.splitPython().

327  def services_(self):
328  """returns a dict of the services that have been added to the Process"""
return DictTypes.FixedKeysDict(self.__services)
def services_
Definition: Config.py:326
def Config.Process.setLooper_ (   self,
  lpr 
)

Definition at line 217 of file Config.py.

References Config.Process._placeLooper().

218  def setLooper_(self,lpr):
self._placeLooper('looper',lpr)
def setLooper_
Definition: Config.py:217
def _placeLooper
Definition: Config.py:702
def Config.Process.setName_ (   self,
  name 
)

Definition at line 195 of file Config.py.

196  def setName_(self,name):
197  if not name.isalnum():
198  raise RuntimeError("Error: The process name is an empty string or contains non-alphanumeric characters")
self.__dict__['_Process__name'] = name
def setName_
Definition: Config.py:195
def Config.Process.setPartialSchedule_ (   self,
  sch,
  label 
)

Definition at line 310 of file Config.py.

References Config.Process._place(), and Config.Process.setSchedule_().

311  def setPartialSchedule_(self,sch,label):
312  if label == "schedule":
313  self.setSchedule_(sch)
314  else:
self._place(label, sch, self.__partialschedules)
def setSchedule_
Definition: Config.py:315
def setPartialSchedule_
Definition: Config.py:310
def Config.Process.setSchedule_ (   self,
  sch 
)

Definition at line 315 of file Config.py.

References str.

Referenced by Config.Process.setPartialSchedule_().

316  def setSchedule_(self,sch):
317  # See if every path and endpath has been inserted into the process
318  index = 0
319  try:
320  for p in sch:
321  p.label_()
322  index +=1
323  except:
324  raise RuntimeError("The path at index "+str(index)+" in the Schedule was not attached to the process.")
self.__dict__['_Process__schedule'] = sch
def setSchedule_
Definition: Config.py:315
#define str(s)
def Config.Process.setSource_ (   self,
  src 
)

Definition at line 211 of file Config.py.

References Config.Process._placeSource().

212  def setSource_(self,src):
self._placeSource('source',src)
def setSource_
Definition: Config.py:211
def _placeSource
Definition: Config.py:694
def Config.Process.setStrict (   self,
  value 
)

Definition at line 151 of file Config.py.

References Config.Process.__isStrict.

152  def setStrict(self, value):
153  self.__isStrict = value
154  _Module.__isStrict__ = True
def setStrict
Definition: Config.py:151
def Config.Process.source_ (   self)
returns the source that has been added to the Process or None if none have been added

Definition at line 208 of file Config.py.

Referenced by Config.Process.dumpConfig(), Config.Process.dumpPython(), and Config.Process.splitPython().

209  def source_(self):
210  """returns the source that has been added to the Process or None if none have been added"""
return self.__source
def Config.Process.splitPython (   self,
  options = PrintOptions() 
)
return a map of file names to python configuration fragments

Definition at line 1033 of file Config.py.

References dataset.Dataset.__name, genericValidation.ValidationWithPlotsSummaryBase.SummaryItem.__name, Config.Process._itemsInDependencyOrder(), Config.Process._splitPython(), Config.Process._splitPythonList(), Config.Process.aliases_(), HLTMuonValidator.analyzers_, Config.Process.analyzers_(), Config.Process.dumpPython(), Config.Process.endpaths_(), FastTimerService::PlotsPerProcess.endpaths_, Config.Process.es_prefers_(), Config.Process.es_producers_(), Config.Process.es_sources_(), pat::eventhypothesis::AndFilter.filters_, pat::eventhypothesis::OrFilter.filters_, pat::TriggerEvent.filters_, TrigObjTnPHistColl::FilterSelector::FilterSet.filters_, FilterOR.filters_, Config.Process.filters_(), cms::DDFilteredView.filters_, FilterSelection.filters_, FilterSelections.filters_, Config.Process.finalpaths_(), join(), Config.Process.looper_(), edm::EventProcessor.looper_, Config.Process.outputModules_(), edm::MainParameterSet.paths_, edm::HLTGlobalStatus.paths_, heppy::TriggerBitChecker.paths_, edm::PathsAndConsumesOfModules.paths_, ProcessCallGraph::ProcessType.paths_, pat::TriggerEvent.paths_, HLTPerformanceInfo.paths_, Config.Process.paths_(), FastTimerService::PlotsPerProcess.paths_, pf2pat::EventHypothesis.producers_, Config.Process.producers_(), Config.Process.psets, EcalDQMonitorTask.schedule_, edm::ModuleChanger.schedule_, edm::ScheduleInfo.schedule_, edm::PathsAndConsumesOfModules.schedule_, edm::SubProcess.schedule_, Config.Process.schedule_(), edm::EventProcessor.schedule_, edm::test::TestProcessor.schedule_, Config.Process.sequences, edm::ProcessDesc.services_, Config.Process.services_(), ecaldqm::DBWriterWorker.source_, L2MuonSeedGeneratorFromL1TkMu.source_, SiStripFedCablingBuilderFromDb.source_, jsoncollector::DataPoint.source_, sistrip::SpyEventMatcher.source_, ProcessCallGraph.source_, Config.Process.source_(), edm::InputSource::EventSourceSentry.source_, edm::InputSource::LumiSourceSentry.source_, edm::InputSource::RunSourceSentry.source_, edm::InputSource::ProcessBlockSourceSentry.source_, Config.Process.subProcesses_(), edm::SubProcess.subProcesses_, edm::EventProcessor.subProcesses_, Config.Process.switchProducers_(), Config.Process.tasks, and Config.Process.vpsets.

1034  def splitPython(self, options = PrintOptions()):
1035  """return a map of file names to python configuration fragments"""
1036  specialImportRegistry._reset()
1037  # extract individual fragments
1038  options.isCfg = False
1039  header = "import FWCore.ParameterSet.Config as cms"
1040  result = ''
1041  parts = {}
1042  files = {}
1043 
1044  result = 'process = cms.Process("' + self.__name + '")\n\n'
1045 
1046  if self.source_():
1047  parts['source'] = (None, 'source = ' + self.source_().dumpPython(options))
1048 
1049  if self.looper_():
1050  parts['looper'] = (None, 'looper = ' + self.looper_().dumpPython())
1051 
1052  parts.update(self._splitPythonList('psets', self.psets, options))
1053  parts.update(self._splitPythonList('psets', self.vpsets, options))
1054  # FIXME
1055  #parts.update(self._splitPythonSubProcesses(self.subProcesses_(), options))
1056  if len(self.subProcesses_()):
1057  sys.stderr.write("error: subprocesses are not supported yet\n\n")
1058  parts.update(self._splitPythonList('modules', self.producers_(), options))
1059  parts.update(self._splitPythonList('modules', self.switchProducers_(), options))
1060  parts.update(self._splitPythonList('modules', self.filters_() , options))
1061  parts.update(self._splitPythonList('modules', self.analyzers_(), options))
1062  parts.update(self._splitPythonList('modules', self.outputModules_(), options))
1063  parts.update(self._splitPythonList('services', self.services_(), options))
1064  parts.update(self._splitPythonList('eventsetup', self.es_producers_(), options))
1065  parts.update(self._splitPythonList('eventsetup', self.es_sources_(), options))
1066  parts.update(self._splitPython('eventsetup', self.es_prefers_(), options))
1067  parts.update(self._splitPythonList('tasks', self._itemsInDependencyOrder(self.tasks), options))
1068  parts.update(self._splitPythonList('sequences', self._itemsInDependencyOrder(self.sequences), options))
1069  parts.update(self._splitPythonList('paths', self.paths_(), options))
1070  parts.update(self._splitPythonList('paths', self.endpaths_(), options))
1071  parts.update(self._splitPythonList('paths', self.finalpaths_(), options))
1072  parts.update(self._splitPythonList('modules', self.aliases_(), options))
1073 
1074  if options.targetDirectory is not None:
1075  files[options.targetDirectory + '/__init__.py'] = ''
1076 
1077  if options.useSubdirectories:
1078  for sub in 'psets', 'modules', 'services', 'eventsetup', 'tasks', 'sequences', 'paths':
1079  if options.targetDirectory is not None:
1080  sub = options.targetDirectory + '/' + sub
1081  files[sub + '/__init__.py'] = ''
1082 
1083  # case insensitive sort by subfolder and module name
1084  parts = sorted(parts.items(), key = lambda nsc: (nsc[1][0].lower() if nsc[1][0] else '', nsc[0].lower()))
1085 
1086  for (name, (subfolder, code)) in parts:
1087  filename = name + '_cfi'
1088  if options.useSubdirectories and subfolder:
1089  filename = subfolder + '/' + filename
1090  if options.targetDirectory is not None:
1091  filename = options.targetDirectory + '/' + filename
1092  result += 'process.load("%s")\n' % filename
1093  files[filename + '.py'] = header + '\n\n' + code
1094 
1095  if self.schedule_() is not None:
1096  options.isCfg = True
1097  result += '\nprocess.schedule = ' + self.schedule.dumpPython(options)
1098 
1099  imports = specialImportRegistry.getSpecialImports()
1100  if len(imports) > 0:
1101  header += '\n' + '\n'.join(imports)
1102  files['-'] = header + '\n\n' + result
1103  return files
def es_sources_
Definition: Config.py:338
def _itemsInDependencyOrder
Definition: Config.py:928
def es_producers_
Definition: Config.py:334
def aliases_
Definition: Config.py:346
def filters_
Definition: Config.py:189
def _splitPythonList
Definition: Config.py:889
def dumpPython
Definition: Config.py:997
def es_prefers_
Definition: Config.py:342
def splitPython
Definition: Config.py:1033
def outputModules_
Definition: Config.py:283
def producers_
Definition: Config.py:200
def analyzers_
Definition: Config.py:279
def switchProducers_
Definition: Config.py:204
def services_
Definition: Config.py:326
def schedule_
Definition: Config.py:307
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def _splitPython
Definition: Config.py:991
def finalpaths_
Definition: Config.py:295
def subProcesses_
Definition: Config.py:275
def endpaths_
Definition: Config.py:291
def Config.Process.subProcesses_ (   self)
returns a list of the subProcesses that have been added to the Process

Definition at line 275 of file Config.py.

Referenced by Config.Process.dumpConfig(), Config.Process.dumpPython(), and Config.Process.splitPython().

276  def subProcesses_(self):
277  """returns a list of the subProcesses that have been added to the Process"""
return self.__subProcesses
def subProcesses_
Definition: Config.py:275
def Config.Process.switchProducerNames (   self)
Returns a string containing all the SwitchProducer labels separated by a blank

Definition at line 159 of file Config.py.

References join(), relativeConstraints.keys, and Config.Process.switchProducers_().

160  def switchProducerNames(self):
161  """Returns a string containing all the SwitchProducer labels separated by a blank"""
return ' '.join(self.switchProducers_().keys())
def switchProducerNames
Definition: Config.py:159
def switchProducers_
Definition: Config.py:204
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def Config.Process.switchProducers_ (   self)
returns a dict of the SwitchProducers that have been added to the Process

Definition at line 204 of file Config.py.

Referenced by Config.Process.dumpConfig(), Config.Process.dumpPython(), Config.Process.prune(), Config.Process.splitPython(), and Config.Process.switchProducerNames().

205  def switchProducers_(self):
206  """returns a dict of the SwitchProducers that have been added to the Process"""
return DictTypes.FixedKeysDict(self.__switchproducers)
def switchProducers_
Definition: Config.py:204
def Config.Process.tasks_ (   self)
returns a dict of the tasks that have been added to the Process

Definition at line 303 of file Config.py.

304  def tasks_(self):
305  """returns a dict of the tasks that have been added to the Process"""
return DictTypes.FixedKeysDict(self.__tasks)
def Config.Process.validate (   self)

Definition at line 1439 of file Config.py.

1440  def validate(self):
1441  # check if there's some input
1442  # Breaks too many unit tests for now
1443  #if self.source_() == None and self.looper_() == None:
1444  # raise RuntimeError("No input source was found for this process")
1445  pass
def Config.Process.vpsets_ (   self)
returns a dict of the VPSets that have been added to the Process

Definition at line 354 of file Config.py.

Referenced by Config.Process.prune().

355  def vpsets_(self):
356  """returns a dict of the VPSets that have been added to the Process"""
return DictTypes.FixedKeysDict(self.__vpsets)

Member Data Documentation

Config.Process.__isStrict
private

Definition at line 137 of file Config.py.

Referenced by Config.Process.__setattr__(), Config.Process._okToPlace(), Config.Process._place(), Config.Process.add_(), and Config.Process.setStrict().

Config.Process.__ppset
private

Definition at line 1374 of file Config.py.

Config.Process.__process
private

Definition at line 1375 of file Config.py.

Referenced by Config.ProcessFragment.__delattr__(), Config.ProcessFragment.__dir__(), Config.ProcessForProcessAccelerator.__getattr__(), Config.ProcessFragment.__getattribute__(), Config.ProcessFragment.__setattr__(), Config.ProcessForProcessAccelerator.__setattr__(), and Config.SubProcess.process().

Config.Process.__processPSet
private

Definition at line 1364 of file Config.py.

Config.Process.__thelist
private

Definition at line 1363 of file Config.py.

Config.Process.maxEvents

Definition at line 141 of file Config.py.

Config.Process.maxLuminosityBlocks

Definition at line 142 of file Config.py.

Config.Process.MessageLogger

Definition at line 147 of file Config.py.

Config.Process.options

Definition at line 140 of file Config.py.

Referenced by betterConfigParser.BetterConfigParser.__updateDict(), submitPVValidationJobs.BetterConfigParser.__updateDict(), confdb.HLTProcess.buildOptions(), betterConfigParser.BetterConfigParser.checkInput(), CrabHelper.CrabHelper.crab_config_filename(), CrabHelper.CrabHelper.crab_taskname(), CrabHelper.CrabHelper.fill_options_from_crab_config(), confdb.HLTProcess.fixPrescales(), edmIntegrityCheck.IntegrityCheck.query(), cmsswPreprocessor.CmsswPreprocessor.run(), production_tasks.BaseDataset.run(), production_tasks.GenerateMask.run(), production_tasks.RunCMSBatch.run(), production_tasks.MonitorJobs.run(), production_tasks.CheckJobStatus.run(), and production_tasks.CleanJobFiles.run().

Property Documentation

Config.Process.aliases = property(aliases_,doc="dictionary containing the aliases for the process")
static

Definition at line 349 of file Config.py.

Config.Process.analyzers = property(analyzers_,doc="dictionary containing the analyzers for the process")
static

Definition at line 282 of file Config.py.

Referenced by looper.Looper.loop(), and looper.Looper.write().

Config.Process.endpaths = property(endpaths_,doc="dictionary containing the endpaths for the process")
static

Definition at line 294 of file Config.py.

Referenced by Config.Process.__setattr__(), and Config.Process.prune().

Config.Process.es_prefers = property(es_prefers_,doc="dictionary containing the es_prefers for the process")
static

Definition at line 345 of file Config.py.

Config.Process.es_producers = property(es_producers_,doc="dictionary containing the es_producers for the process")
static

Definition at line 337 of file Config.py.

Config.Process.es_sources = property(es_sources_,doc="dictionary containing the es_sources for the process")
static

Definition at line 341 of file Config.py.

Config.Process.filters = property(filters_, doc="dictionary containing the filters for the process")
static

Definition at line 192 of file Config.py.

Config.Process.finalpaths = property(finalpaths_,doc="dictionary containing the finalpaths for the process")
static

Definition at line 298 of file Config.py.

Referenced by Config.Process.__setattr__(), and Config.Process.prune().

Config.Process.looper = property(looper_,setLooper_,doc='the main looper or None if not set')
static

Definition at line 219 of file Config.py.

Config.Process.outputModules = property(outputModules_,doc="dictionary containing the output_modules for the process")
static

Definition at line 286 of file Config.py.

Config.Process.paths = property(paths_,doc="dictionary containing the paths for the process")
static

Definition at line 290 of file Config.py.

Referenced by Config.Process.__setattr__(), and Config.Process.prune().

Config.Process.process = property(name_,setName_, doc="name of the process")
static

Definition at line 199 of file Config.py.

Referenced by adaptToRunAtMiniAOD.adaptToRunAtMiniAOD.convertModuleToMiniAODInput(), runTauIdMVA.TauIDEmbedder.processDeepProducer(), runTauIdMVA.TauIDEmbedder.runTauID(), and runTauIdMVA.TauIDEmbedder.tauIDMVAinputs().

Config.Process.processAccelerators = property(processAccelerators_,doc="dictionary containing the ProcessAccelerators for the process")
static

Definition at line 333 of file Config.py.

Config.Process.producers = property(producers_,doc="dictionary containing the producers for the process")
static

Definition at line 203 of file Config.py.

Config.Process.psets = property(psets_,doc="dictionary containing the PSets for the process")
static

Definition at line 353 of file Config.py.

Referenced by Config.Process.dumpPython(), and Config.Process.splitPython().

Config.Process.schedule = property(schedule_,setSchedule_,doc='the schedule or None if not set')
static

Definition at line 325 of file Config.py.

Referenced by Config.Process.dumpConfig().

Config.Process.sequences = property(sequences_,doc="dictionary containing the sequences for the process")
static

Definition at line 302 of file Config.py.

Referenced by Config.Process.__setattr__(), Config.Process.dumpPython(), Config.Process.prune(), and Config.Process.splitPython().

Config.Process.services = property(services_,doc="dictionary containing the services for the process")
static

Definition at line 329 of file Config.py.

Referenced by config.Config.__str__().

Config.Process.source = property(source_,setSource_,doc='the main source or None if not set')
static

Definition at line 213 of file Config.py.

Referenced by confdb.HLTProcess.build_source(), and confdb.HLTProcess.specificCustomize().

Config.Process.subProcesses = property(subProcesses_,doc='the SubProcesses that have been added to the Process')
static

Definition at line 278 of file Config.py.

Config.Process.switchProducers = property(switchProducers_,doc="dictionary containing the SwitchProducers for the process")
static

Definition at line 207 of file Config.py.

Config.Process.tasks = property(tasks_,doc="dictionary containing the tasks for the process")
static

Definition at line 306 of file Config.py.

Referenced by Config.Process.__setattr__(), Config.Process.dumpPython(), Config.Process.prune(), and Config.Process.splitPython().

Config.Process.vpsets = property(vpsets_,doc="dictionary containing the PSets for the process")
static

Definition at line 357 of file Config.py.

Referenced by Config.Process.dumpPython(), and Config.Process.splitPython().