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 isUsingModifier
 
def load
 
def looper_
 
def name_
 
def outputModules_
 
def pathNames
 
def paths_
 
def prefer
 
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")
 
 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 _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.options = Process.defaultOptions_()
141  self.maxEvents = Process.defaultMaxEvents_()
142  self.maxLuminosityBlocks = Process.defaultMaxLuminosityBlocks_()
143  # intentionally not cloned to ensure that everyone taking
144  # MessageLogger still via
145  # FWCore.Message(Logger|Service).MessageLogger_cfi
146  # use the very same MessageLogger object.
147  self.MessageLogger = MessageLogger
148  for m in self.__modifiers:
149  m._setChosen()
def __init__
Definition: Config.py:104

Member Function Documentation

def Config.Process.__delattr__ (   self,
  name 
)

Definition at line 559 of file Config.py.

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

560  def __delattr__(self,name):
561  self._delHelper(name)
562  obj = getattr(self,name)
563  if not obj is None:
564  if not isinstance(obj, Sequence) and not isinstance(obj, Task):
565  # For modules, ES modules and services we can also remove
566  # the deleted object from Sequences, Paths, EndPaths, and
567  # Tasks. Note that for Sequences and Tasks that cannot be done
568  # reliably as the places where the Sequence or Task was used
569  # might have been expanded so we do not even try. We considered
570  # raising an exception if a Sequences or Task was explicitly
571  # deleted, but did not because when done carefully deletion
572  # is sometimes OK (for example in the prune function where it
573  # has been checked that the deleted Sequence is not used).
574  if obj._isTaskComponent():
575  self._replaceInTasks(name, None)
576  self._replaceInSchedule(name, None)
577  if isinstance(obj, _Sequenceable) or obj._isTaskComponent():
578  self._replaceInSequences(name, None)
579  if Schedule._itemIsValid(obj) or isinstance(obj, Task):
580  self._replaceInScheduleDirectly(name, None)
581  # now remove it from the process itself
582  try:
583  del self.__dict__[name]
584  except:
585  pass
def _replaceInSequences
Definition: Config.py:1094
def __delattr__
Definition: Config.py:559
def _delHelper
Definition: Config.py:542
def _replaceInSchedule
Definition: Config.py:1115
def _replaceInScheduleDirectly
Definition: Config.py:1121
def _replaceInTasks
Definition: Config.py:1111
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 529 of file Config.py.

Referenced by Config.Process.__setattr__().

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

Definition at line 388 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().

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

Definition at line 361 of file Config.py.

References gpuClustering.id, and str.

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

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

References gpuClustering.id.

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

Definition at line 261 of file Config.py.

References Config.Process.defaultMaxEvents_().

Referenced by Config.Process.__setattr__().

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

Definition at line 248 of file Config.py.

References Config.Process.defaultOptions_().

Referenced by Config.Process.__setattr__().

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

Definition at line 586 of file Config.py.

References Config.Process._delHelper().

Referenced by Config.Process.__setattr__().

587  def _delattrFromSetattr(self,name):
588  """Similar to __delattr__ but we need different behavior when called from __setattr__"""
589  self._delHelper(name)
590  # now remove it from the process itself
591  try:
592  del self.__dict__[name]
593  except:
594  pass
def _delHelper
Definition: Config.py:542
def _delattrFromSetattr
Definition: Config.py:586
def Config.Process._delHelper (   self,
  name 
)
private

Definition at line 542 of file Config.py.

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

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

Definition at line 858 of file Config.py.

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

Referenced by Config.Process.dumpConfig().

859  def _dumpConfigESPrefers(self, options):
860  result = ''
861  for item in self.es_prefers_().values():
862  result +=options.indentation()+'es_prefer '+item.targetLabel_()+' = '+item.dumpConfig(options)
863  return result
def _dumpConfigESPrefers
Definition: Config.py:858
def es_prefers_
Definition: Config.py:336
def Config.Process._dumpConfigNamedList (   self,
  items,
  typeName,
  options 
)
private

Definition at line 769 of file Config.py.

Referenced by Config.Process.dumpConfig().

770  def _dumpConfigNamedList(self,items,typeName,options):
771  returnValue = ''
772  for name,item in items:
773  returnValue +=options.indentation()+typeName+' '+name+' = '+item.dumpConfig(options)
774  return returnValue
def _dumpConfigNamedList
Definition: Config.py:769
def Config.Process._dumpConfigOptionallyNamedList (   self,
  items,
  typeName,
  options 
)
private

Definition at line 781 of file Config.py.

Referenced by Config.Process.dumpConfig().

782  def _dumpConfigOptionallyNamedList(self,items,typeName,options):
783  returnValue = ''
784  for name,item in items:
785  if name == item.type_():
786  name = ''
787  returnValue +=options.indentation()+typeName+' '+name+' = '+item.dumpConfig(options)
788  return returnValue
def _dumpConfigOptionallyNamedList
Definition: Config.py:781
def Config.Process._dumpConfigUnnamedList (   self,
  items,
  typeName,
  options 
)
private

Definition at line 775 of file Config.py.

Referenced by Config.Process.dumpConfig().

776  def _dumpConfigUnnamedList(self,items,typeName,options):
777  returnValue = ''
778  for name,item in items:
779  returnValue +=options.indentation()+typeName+' = '+item.dumpConfig(options)
780  return returnValue
def _dumpConfigUnnamedList
Definition: Config.py:775
def Config.Process._dumpPython (   self,
  d,
  options 
)
private

Definition at line 976 of file Config.py.

Referenced by Config.Process.dumpPython().

977  def _dumpPython(self, d, options):
978  result = ''
979  for name, value in sorted(d.items()):
980  result += value.dumpPythonAs(name,options)+'\n'
981  return result
def _dumpPython
Definition: Config.py:976
def Config.Process._dumpPythonList (   self,
  d,
  options 
)
private

Definition at line 870 of file Config.py.

Referenced by Config.Process.dumpPython().

871  def _dumpPythonList(self, d, options):
872  returnValue = ''
873  if isinstance(d, DictTypes.SortedKeysDict):
874  for name,item in d.items():
875  returnValue +='process.'+name+' = '+item.dumpPython(options)+'\n\n'
876  else:
877  for name,item in sorted(d.items()):
878  returnValue +='process.'+name+' = '+item.dumpPython(options)+'\n\n'
879  return returnValue
def _dumpPythonList
Definition: Config.py:870
def Config.Process._dumpPythonSubProcesses (   self,
  l,
  options 
)
private

Definition at line 864 of file Config.py.

Referenced by Config.Process.dumpPython().

865  def _dumpPythonSubProcesses(self, l, options):
866  returnValue = ''
867  for item in l:
868  returnValue += item.dumpPython(options)+'\n\n'
869  return returnValue
def _dumpPythonSubProcesses
Definition: Config.py:864
def Config.Process._findPreferred (   self,
  esname,
  d,
  args,
  kargs 
)
private

Definition at line 1463 of file Config.py.

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

1464  def _findPreferred(self, esname, d,*args,**kargs):
1465  # is esname a name in the dictionary?
1466  if esname in d:
1467  typ = d[esname].type_()
1468  if typ == esname:
1469  self.__setattr__( esname+"_prefer", ESPrefer(typ,*args,**kargs) )
1470  else:
1471  self.__setattr__( esname+"_prefer", ESPrefer(typ, esname,*args,**kargs) )
1472  return True
1473  else:
1474  # maybe it's an unnamed ESModule?
1475  found = False
1476  for name, value in d.items():
1477  if value.type_() == esname:
1478  if found:
1479  raise RuntimeError("More than one ES module for "+esname)
1480  found = True
1481  self.__setattr__(esname+"_prefer", ESPrefer(d[esname].type_()) )
1482  return found
1483 
def _findPreferred
Definition: Config.py:1463
def __setattr__
Definition: Config.py:388
def Config.Process._insertInto (   self,
  parameterSet,
  itemDict 
)
private

Definition at line 1131 of file Config.py.

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

Definition at line 1141 of file Config.py.

1142  def _insertManyInto(self, parameterSet, label, itemDict, tracked):
1143  l = []
1144  for name,value in itemDict.items():
1145  value.appendToProcessDescList_(l, name)
1146  value.insertInto(parameterSet, name)
1147  # alphabetical order is easier to compare with old language
1148  l.sort()
parameterSet.addVString(tracked, label, l)
def _insertManyInto
Definition: Config.py:1141
def Config.Process._insertOneInto (   self,
  parameterSet,
  label,
  item,
  tracked 
)
private

Definition at line 1134 of file Config.py.

1135  def _insertOneInto(self, parameterSet, label, item, tracked):
1136  vitems = []
1137  if not item == None:
1138  newlabel = item.nameInProcessDesc_(label)
1139  vitems = [newlabel]
1140  item.insertInto(parameterSet, newlabel)
parameterSet.addVString(tracked, label, vitems)
def _insertOneInto
Definition: Config.py:1134
def Config.Process._insertPaths (   self,
  processPSet,
  nodeVisitor 
)
private

Definition at line 1172 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_.

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

Definition at line 1159 of file Config.py.

1160  def _insertSubProcessesInto(self, parameterSet, label, itemList, tracked):
1161  l = []
1162  subprocs = []
1163  for value in itemList:
1164  name = value.getProcessName()
1165  newLabel = value.nameInProcessDesc_(name)
1166  l.append(newLabel)
1167  pset = value.getSubProcessPSet(parameterSet)
1168  subprocs.append(pset)
1169  # alphabetical order is easier to compare with old language
1170  l.sort()
1171  parameterSet.addVString(tracked, label, l)
parameterSet.addVPSet(False,"subProcesses",subprocs)
def _insertSubProcessesInto
Definition: Config.py:1159
def Config.Process._insertSwitchProducersInto (   self,
  parameterSet,
  labelModules,
  labelAliases,
  itemDict,
  tracked 
)
private

Definition at line 1149 of file Config.py.

1150  def _insertSwitchProducersInto(self, parameterSet, labelModules, labelAliases, itemDict, tracked):
1151  modules = parameterSet.getVString(tracked, labelModules)
1152  aliases = parameterSet.getVString(tracked, labelAliases)
1153  for name,value in itemDict.items():
1154  value.appendToProcessDescLists_(modules, aliases, name)
1155  value.insertInto(parameterSet, name)
1156  modules.sort()
1157  aliases.sort()
1158  parameterSet.addVString(tracked, labelModules, modules)
parameterSet.addVString(tracked, labelAliases, aliases)
def _insertSwitchProducersInto
Definition: Config.py:1149
def Config.Process._itemsInDependencyOrder (   self,
  processDictionaryOfItems 
)
private

Definition at line 919 of file Config.py.

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

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

Definition at line 610 of file Config.py.

References Config.Process.__isStrict.

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

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

Definition at line 631 of file Config.py.

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

Referenced by 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_().

632  def _place(self, name, mod, d):
633  if self._okToPlace(name, mod, d):
634  if self.__isStrict and isinstance(mod, _ModuleSequenceType):
635  d[name] = mod._postProcessFixup(self._cloneToObjectDict)
636  else:
637  d[name] = mod
638  if isinstance(mod,_Labelable):
self.__setObjectLabel(mod, name)
def __setObjectLabel
Definition: Config.py:361
def _okToPlace
Definition: Config.py:610
def Config.Process._placeAlias (   self,
  name,
  mod 
)
private

Definition at line 682 of file Config.py.

References Config.Process._place().

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

Definition at line 647 of file Config.py.

References Config.Process._place().

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

Definition at line 656 of file Config.py.

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

657  def _placeEndPath(self,name,mod):
658  self._validateSequence(mod, name)
659  try:
660  self._place(name, mod, self.__endpaths)
661  except ModuleCloneError as msg:
662  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:901
def _placeEndPath
Definition: Config.py:656
def Config.Process._placeESPrefer (   self,
  name,
  mod 
)
private

Definition at line 675 of file Config.py.

References Config.Process._place().

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

Definition at line 673 of file Config.py.

References Config.Process._place().

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

Definition at line 677 of file Config.py.

References Config.Process._place().

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

Definition at line 645 of file Config.py.

References Config.Process._place().

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

Definition at line 663 of file Config.py.

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

664  def _placeFinalPath(self,name,mod):
665  self._validateSequence(mod, name)
666  try:
667  self._place(name, mod, self.__finalpaths)
668  except ModuleCloneError as msg:
669  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:901
def _placeFinalPath
Definition: Config.py:663
def Config.Process._placeLooper (   self,
  name,
  mod 
)
private

Definition at line 696 of file Config.py.

Referenced by Config.Process.setLooper_().

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

Definition at line 639 of file Config.py.

References Config.Process._place().

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

Definition at line 649 of file Config.py.

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

650  def _placePath(self,name,mod):
651  self._validateSequence(mod, name)
652  try:
653  self._place(name, mod, self.__paths)
654  except ModuleCloneError as msg:
655  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:901
def _placePath
Definition: Config.py:649
def Config.Process._placeProducer (   self,
  name,
  mod 
)
private

Definition at line 641 of file Config.py.

References Config.Process._place().

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

Definition at line 684 of file Config.py.

References Config.Process._place().

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

Definition at line 670 of file Config.py.

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

671  def _placeSequence(self,name,mod):
672  self._validateSequence(mod, name)
self._place(name, mod, self.__sequences)
def _validateSequence
Definition: Config.py:901
def _placeSequence
Definition: Config.py:670
def Config.Process._placeService (   self,
  typeName,
  mod 
)
private

Definition at line 706 of file Config.py.

References Config.Process._place().

707  def _placeService(self,typeName,mod):
708  self._place(typeName, mod, self.__services)
709  if typeName in self.__dict__:
710  self.__dict__[typeName]._inProcess = False
self.__dict__[typeName]=mod
def _placeService
Definition: Config.py:706
def Config.Process._placeSource (   self,
  name,
  mod 
)
private
Allow the source to be referenced by 'source' or by type name

Definition at line 688 of file Config.py.

Referenced by Config.Process.setSource_().

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

Definition at line 701 of file Config.py.

702  def _placeSubProcess(self,name,mod):
703  self.__dict__['_Process__subProcess'] = mod
self.__dict__[mod.type_()] = mod
def _placeSubProcess
Definition: Config.py:701
def Config.Process._placeSwitchProducer (   self,
  name,
  mod 
)
private

Definition at line 643 of file Config.py.

References Config.Process._place().

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

Definition at line 679 of file Config.py.

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

680  def _placeTask(self,name,task):
681  self._validateTask(task, name)
self._place(name, task, self.__tasks)
def _validateTask
Definition: Config.py:910
def _placeTask
Definition: Config.py:679
def Config.Process._placeVPSet (   self,
  name,
  mod 
)
private

Definition at line 686 of file Config.py.

References Config.Process._place().

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

Definition at line 1341 of file Config.py.

Referenced by Config.Process.prune().

1342  def _pruneModules(self, d, scheduledNames):
1343  moduleNames = set(d.keys())
1344  junk = moduleNames - scheduledNames
1345  for name in junk:
1346  delattr(self, name)
1347  return junk
def _pruneModules
Definition: Config.py:1341
def Config.Process._replaceInSchedule (   self,
  label,
  new 
)
private

Definition at line 1115 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__().

1116  def _replaceInSchedule(self, label, new):
1117  if self.schedule_() == None:
1118  return
1119  old = getattr(self,label)
1120  for task in self.schedule_()._tasks:
task.replace(old, new)
def _replaceInSchedule
Definition: Config.py:1115
def schedule_
Definition: Config.py:305
def Config.Process._replaceInScheduleDirectly (   self,
  label,
  new 
)
private

Definition at line 1121 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__().

1122  def _replaceInScheduleDirectly(self, label, new):
1123  if self.schedule_() == None:
1124  return
1125  old = getattr(self,label)
self.schedule_()._replaceIfHeldDirectly(old, new)
def _replaceInScheduleDirectly
Definition: Config.py:1121
def schedule_
Definition: Config.py:305
def Config.Process._replaceInSequences (   self,
  label,
  new 
)
private

Definition at line 1094 of file Config.py.

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

1095  def _replaceInSequences(self, label, new):
1096  old = getattr(self,label)
1097  #TODO - replace by iterator concatenation
1098  #to ovoid dependency problems between sequences, first modify
1099  # process known sequences to do a non-recursive change. Then do
1100  # a recursive change to get cases where a sub-sequence unknown to
1101  # the process has the item to be replaced
1102  for sequenceable in self.sequences.values():
1103  sequenceable._replaceIfHeldDirectly(old,new)
1104  for sequenceable in self.sequences.values():
1105  sequenceable.replace(old,new)
1106  for sequenceable in self.paths.values():
1107  sequenceable.replace(old,new)
1108  for sequenceable in self.endpaths.values():
1109  sequenceable.replace(old,new)
1110  for sequenceable in self.finalpaths.values():
sequenceable.replace(old,new)
def _replaceInSequences
Definition: Config.py:1094
def Config.Process._replaceInTasks (   self,
  label,
  new 
)
private

Definition at line 1111 of file Config.py.

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

1112  def _replaceInTasks(self, label, new):
1113  old = getattr(self,label)
1114  for task in self.tasks.values():
task.replace(old, new)
def _replaceInTasks
Definition: Config.py:1111
def Config.Process._splitPython (   self,
  subfolder,
  d,
  options 
)
private

Definition at line 982 of file Config.py.

Referenced by Config.Process.splitPython().

983  def _splitPython(self, subfolder, d, options):
984  result = {}
985  for name, value in sorted(d.items()):
986  result[name] = subfolder, value.dumpPythonAs(name, options) + '\n'
987  return result
def _splitPython
Definition: Config.py:982
def Config.Process._splitPythonList (   self,
  subfolder,
  d,
  options 
)
private

Definition at line 880 of file Config.py.

Referenced by Config.Process.splitPython().

881  def _splitPythonList(self, subfolder, d, options):
882  parts = DictTypes.SortedKeysDict()
883  for name, item in d.items() if isinstance(d, DictTypes.SortedKeysDict) else sorted(d.items()):
884  code = ''
885  dependencies = item.directDependencies()
886  for module_subfolder, module in dependencies:
887  module = module + '_cfi'
888  if options.useSubdirectories and module_subfolder:
889  module = module_subfolder + '.' + module
890  if options.targetDirectory is not None:
891  if options.useSubdirectories and subfolder:
892  module = '..' + module
893  else:
894  module = '.' + module
895  code += 'from ' + module + ' import *\n'
896  if dependencies:
897  code += '\n'
898  code += name + ' = ' + item.dumpPython(options)
899  parts[name] = subfolder, code
900  return parts
def _splitPythonList
Definition: Config.py:880
def Config.Process._validateSequence (   self,
  sequence,
  label 
)
private

Definition at line 901 of file Config.py.

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

902  def _validateSequence(self, sequence, label):
903  # See if every module has been inserted into the process
904  try:
905  l = set()
906  visitor = NodeNameVisitor(l)
907  sequence.visit(visitor)
908  except:
909  raise RuntimeError("An entry in sequence "+label + ' has no label')
def _validateSequence
Definition: Config.py:901
def Config.Process._validateTask (   self,
  task,
  label 
)
private

Definition at line 910 of file Config.py.

Referenced by Config.Process._placeTask().

911  def _validateTask(self, task, label):
912  # See if every module and service has been inserted into the process
913  try:
914  l = set()
915  visitor = NodeNameVisitor(l)
916  task.visit(visitor)
917  except:
918  raise RuntimeError("An entry in task " + label + ' has not been attached to the process')
def _validateTask
Definition: Config.py:910
def Config.Process.add_ (   self,
  value 
)
Allows addition of components that do not have to have a label, e.g. Services

Definition at line 595 of file Config.py.

References Config.Process.__isStrict.

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

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

Definition at line 704 of file Config.py.

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

Definition at line 340 of file Config.py.

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

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

Definition at line 161 of file Config.py.

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

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

Definition at line 277 of file Config.py.

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

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

Definition at line 258 of file Config.py.

Referenced by Config.Process.__updateMaxEvents().

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

Definition at line 271 of file Config.py.

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

Definition at line 220 of file Config.py.

Referenced by Config.Process.__updateOptions().

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

Definition at line 789 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().

790  def dumpConfig(self, options=PrintOptions()):
791  """return a string containing the equivalent process defined using the old configuration language"""
792  config = "process "+self.__name+" = {\n"
793  options.indent()
794  if self.source_():
795  config += options.indentation()+"source = "+self.source_().dumpConfig(options)
796  if self.looper_():
797  config += options.indentation()+"looper = "+self.looper_().dumpConfig(options)
798 
799  config+=self._dumpConfigNamedList(self.subProcesses_(),
800  'subProcess',
801  options)
802  config+=self._dumpConfigNamedList(self.producers_().items(),
803  'module',
804  options)
805  config+=self._dumpConfigNamedList(self.switchProducers_().items(),
806  'module',
807  options)
808  config+=self._dumpConfigNamedList(self.filters_().items(),
809  'module',
810  options)
811  config+=self._dumpConfigNamedList(self.analyzers_().items(),
812  'module',
813  options)
814  config+=self._dumpConfigNamedList(self.outputModules_().items(),
815  'module',
816  options)
817  config+=self._dumpConfigNamedList(self.sequences_().items(),
818  'sequence',
819  options)
820  config+=self._dumpConfigNamedList(self.paths_().items(),
821  'path',
822  options)
823  config+=self._dumpConfigNamedList(self.endpaths_().items(),
824  'endpath',
825  options)
826  config+=self._dumpConfigNamedList(self.finalpaths_().items(),
827  'finalpath',
828  options)
829  config+=self._dumpConfigUnnamedList(self.services_().items(),
830  'service',
831  options)
832  config+=self._dumpConfigNamedList(self.aliases_().items(),
833  'alias',
834  options)
835  config+=self._dumpConfigOptionallyNamedList(
836  self.es_producers_().items(),
837  'es_module',
838  options)
839  config+=self._dumpConfigOptionallyNamedList(
840  self.es_sources_().items(),
841  'es_source',
842  options)
843  config += self._dumpConfigESPrefers(options)
844  for name,item in self.psets.items():
845  config +=options.indentation()+item.configTypeName()+' '+name+' = '+item.configValue(options)
846  for name,item in self.vpsets.items():
847  config +=options.indentation()+'VPSet '+name+' = '+item.configValue(options)
848  if self.schedule:
849  pathNames = [p.label_() for p in self.schedule]
850  config +=options.indentation()+'schedule = {'+','.join(pathNames)+'}\n'
851 
852 # config+=self._dumpConfigNamedList(self.vpsets.items(),
853 # 'VPSet',
854 # options)
855  config += "}\n"
856  options.unindent()
857  return config
def es_sources_
Definition: Config.py:332
def _dumpConfigUnnamedList
Definition: Config.py:775
def es_producers_
Definition: Config.py:328
def aliases_
Definition: Config.py:340
def _dumpConfigESPrefers
Definition: Config.py:858
def _dumpConfigOptionallyNamedList
Definition: Config.py:781
def filters_
Definition: Config.py:188
def outputModules_
Definition: Config.py:281
def producers_
Definition: Config.py:199
def analyzers_
Definition: Config.py:277
def switchProducers_
Definition: Config.py:203
def dumpConfig
Definition: Config.py:789
def services_
Definition: Config.py:324
def sequences_
Definition: Config.py:297
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def _dumpConfigNamedList
Definition: Config.py:769
def finalpaths_
Definition: Config.py:293
def subProcesses_
Definition: Config.py:273
def endpaths_
Definition: Config.py:289
def Config.Process.dumpPython (   self,
  options = PrintOptions() 
)
return a string containing the equivalent process defined using python

Definition at line 988 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_, 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().

989  def dumpPython(self, options=PrintOptions()):
990  """return a string containing the equivalent process defined using python"""
991  specialImportRegistry._reset()
992  header = "import FWCore.ParameterSet.Config as cms"
993  result = "process = cms.Process(\""+self.__name+"\")\n\n"
994  if self.source_():
995  result += "process.source = "+self.source_().dumpPython(options)
996  if self.looper_():
997  result += "process.looper = "+self.looper_().dumpPython()
998  result+=self._dumpPythonList(self.psets, options)
999  result+=self._dumpPythonList(self.vpsets, options)
1000  result+=self._dumpPythonSubProcesses(self.subProcesses_(), options)
1001  result+=self._dumpPythonList(self.producers_(), options)
1002  result+=self._dumpPythonList(self.switchProducers_(), options)
1003  result+=self._dumpPythonList(self.filters_() , options)
1004  result+=self._dumpPythonList(self.analyzers_(), options)
1005  result+=self._dumpPythonList(self.outputModules_(), options)
1006  result+=self._dumpPythonList(self.services_(), options)
1007  result+=self._dumpPythonList(self.es_producers_(), options)
1008  result+=self._dumpPythonList(self.es_sources_(), options)
1009  result+=self._dumpPython(self.es_prefers_(), options)
1010  result+=self._dumpPythonList(self._itemsInDependencyOrder(self.tasks), options)
1011  result+=self._dumpPythonList(self._itemsInDependencyOrder(self.sequences), options)
1012  result+=self._dumpPythonList(self.paths_(), options)
1013  result+=self._dumpPythonList(self.endpaths_(), options)
1014  result+=self._dumpPythonList(self.finalpaths_(), options)
1015  result+=self._dumpPythonList(self.aliases_(), options)
1016  if not self.schedule_() == None:
1017  result += 'process.schedule = ' + self.schedule.dumpPython(options)
1018  imports = specialImportRegistry.getSpecialImports()
1019  if len(imports) > 0:
1020  header += "\n" + "\n".join(imports)
1021  header += "\n\n"
1022  return header+result
def es_sources_
Definition: Config.py:332
def _itemsInDependencyOrder
Definition: Config.py:919
def es_producers_
Definition: Config.py:328
def aliases_
Definition: Config.py:340
def filters_
Definition: Config.py:188
def dumpPython
Definition: Config.py:988
def es_prefers_
Definition: Config.py:336
def _dumpPythonSubProcesses
Definition: Config.py:864
def outputModules_
Definition: Config.py:281
def producers_
Definition: Config.py:199
def analyzers_
Definition: Config.py:277
def switchProducers_
Definition: Config.py:203
def services_
Definition: Config.py:324
def schedule_
Definition: Config.py:305
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def _dumpPythonList
Definition: Config.py:870
def finalpaths_
Definition: Config.py:293
def subProcesses_
Definition: Config.py:273
def _dumpPython
Definition: Config.py:976
def endpaths_
Definition: Config.py:289
def Config.Process.endpaths_ (   self)
returns a dict of the endpaths that have been added to the Process

Definition at line 289 of file Config.py.

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

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

Definition at line 336 of file Config.py.

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

337  def es_prefers_(self):
338  """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:336
def Config.Process.es_producers_ (   self)
returns a dict of the esproducers that have been added to the Process

Definition at line 328 of file Config.py.

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

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

Definition at line 332 of file Config.py.

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

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

Definition at line 715 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().

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

Definition at line 1348 of file Config.py.

References Config.Process.__init__().

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

Definition at line 164 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.

165  def filterNames(self):
166  """Returns a string containing all the EDFilter labels separated by a blank"""
return ' '.join(self.filters_().keys())
def filterNames
Definition: Config.py:164
def filters_
Definition: Config.py:188
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 188 of file Config.py.

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

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

Definition at line 293 of file Config.py.

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

294  def finalpaths_(self):
295  """returns a dict of the finalpaths that have been added to the Process"""
return DictTypes.SortedAndFixedKeysDict(self.__finalpaths)
def finalpaths_
Definition: Config.py:293
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 1126 of file Config.py.

1127  def globalReplace(self,label,new):
1128  """ Replace the item with label 'label' by object 'new' in the process and all sequences/paths/tasks"""
1129  if not hasattr(self,label):
1130  raise LookupError("process has no item of label "+label)
setattr(self,label,new)
def globalReplace
Definition: Config.py:1126
def Config.Process.isUsingModifier (   self,
  mod 
)
returns True if the Modifier is in used by this Process

Definition at line 353 of file Config.py.

354  def isUsingModifier(self,mod):
355  """returns True if the Modifier is in used by this Process"""
356  if mod._isChosen():
357  for m in self.__modifiers:
358  if m._isOrContains(mod):
359  return True
360  return False
def isUsingModifier
Definition: Config.py:353
def Config.Process.load (   self,
  moduleName 
)

Definition at line 711 of file Config.py.

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

712  def load(self, moduleName):
713  moduleName = moduleName.replace("/",".")
714  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 213 of file Config.py.

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

214  def looper_(self):
215  """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 192 of file Config.py.

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

193  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 281 of file Config.py.

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

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

Definition at line 167 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_.

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

Definition at line 285 of file Config.py.

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

286  def paths_(self):
287  """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 1434 of file Config.py.

1435  def prefer(self, esmodule,*args,**kargs):
1436  """Prefer this ES source or producer. The argument can
1437  either be an object label, e.g.,
1438  process.prefer(process.juicerProducer) (not supported yet)
1439  or a name of an ESSource or ESProducer
1440  process.prefer("juicer")
1441  or a type of unnamed ESSource or ESProducer
1442  process.prefer("JuicerProducer")
1443  In addition, you can pass as a labelled arguments the name of the Record you wish to
1444  prefer where the type passed is a cms.vstring and that vstring can contain the
1445  name of the C++ types in the Record that are being preferred, e.g.,
1446  #prefer all data in record 'OrangeRecord' from 'juicer'
1447  process.prefer("juicer", OrangeRecord=cms.vstring())
1448  or
1449  #prefer only "Orange" data in "OrangeRecord" from "juicer"
1450  process.prefer("juicer", OrangeRecord=cms.vstring("Orange"))
1451  or
1452  #prefer only "Orange" data with label "ExtraPulp" in "OrangeRecord" from "juicer"
1453  ESPrefer("ESJuicerProd", OrangeRecord=cms.vstring("Orange/ExtraPulp"))
1454  """
1455  # see if this refers to a named ESProducer
1456  if isinstance(esmodule, ESSource) or isinstance(esmodule, ESProducer):
1457  raise RuntimeError("Syntax of process.prefer(process.esmodule) not supported yet")
1458  elif self._findPreferred(esmodule, self.es_producers_(),*args,**kargs) or \
1459  self._findPreferred(esmodule, self.es_sources_(),*args,**kargs):
1460  pass
1461  else:
1462  raise RuntimeError("Cannot resolve prefer for "+repr(esmodule))
def es_sources_
Definition: Config.py:332
def _findPreferred
Definition: Config.py:1463
def es_producers_
Definition: Config.py:328
def Config.Process.producerNames (   self)
Returns a string containing all the EDProducer labels separated by a blank

Definition at line 155 of file Config.py.

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

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

Definition at line 199 of file Config.py.

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

200  def producers_(self):
201  """returns a dict of the producers that have been added to the Process"""
return DictTypes.FixedKeysDict(self.__producers)
def producers_
Definition: Config.py:199
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 1270 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().

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

Definition at line 344 of file Config.py.

345  def psets_(self):
346  """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 1259 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().

1260  def resolve(self,keepUnresolvedSequencePlaceholders=False):
1261  for x in self.paths.values():
1262  x.resolve(self.__dict__,keepUnresolvedSequencePlaceholders)
1263  for x in self.endpaths.values():
1264  x.resolve(self.__dict__,keepUnresolvedSequencePlaceholders)
1265  for x in self.finalpaths.values():
1266  x.resolve(self.__dict__,keepUnresolvedSequencePlaceholders)
1267  if not self.schedule_() == None:
1268  for task in self.schedule_()._tasks:
1269  task.resolve(self.__dict__,keepUnresolvedSequencePlaceholders)
def schedule_
Definition: Config.py:305
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 305 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().

306  def schedule_(self):
307  """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:305
def Config.Process.sequences_ (   self)
returns a dict of the sequences that have been added to the Process

Definition at line 297 of file Config.py.

Referenced by Config.Process.dumpConfig().

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

Definition at line 324 of file Config.py.

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

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

Definition at line 216 of file Config.py.

References Config.Process._placeLooper().

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

Definition at line 194 of file Config.py.

195  def setName_(self,name):
196  if not name.isalnum():
197  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:194
def Config.Process.setPartialSchedule_ (   self,
  sch,
  label 
)

Definition at line 308 of file Config.py.

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

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

Definition at line 313 of file Config.py.

References str.

Referenced by Config.Process.setPartialSchedule_().

314  def setSchedule_(self,sch):
315  # See if every path and endpath has been inserted into the process
316  index = 0
317  try:
318  for p in sch:
319  p.label_()
320  index +=1
321  except:
322  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:313
#define str(s)
def Config.Process.setSource_ (   self,
  src 
)

Definition at line 210 of file Config.py.

References Config.Process._placeSource().

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

Definition at line 150 of file Config.py.

References Config.Process.__isStrict.

151  def setStrict(self, value):
152  self.__isStrict = value
153  _Module.__isStrict__ = True
def setStrict
Definition: Config.py:150
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 207 of file Config.py.

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

208  def source_(self):
209  """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 1023 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.

1024  def splitPython(self, options = PrintOptions()):
1025  """return a map of file names to python configuration fragments"""
1026  specialImportRegistry._reset()
1027  # extract individual fragments
1028  options.isCfg = False
1029  header = "import FWCore.ParameterSet.Config as cms"
1030  result = ''
1031  parts = {}
1032  files = {}
1033 
1034  result = 'process = cms.Process("' + self.__name + '")\n\n'
1035 
1036  if self.source_():
1037  parts['source'] = (None, 'source = ' + self.source_().dumpPython(options))
1038 
1039  if self.looper_():
1040  parts['looper'] = (None, 'looper = ' + self.looper_().dumpPython())
1041 
1042  parts.update(self._splitPythonList('psets', self.psets, options))
1043  parts.update(self._splitPythonList('psets', self.vpsets, options))
1044  # FIXME
1045  #parts.update(self._splitPythonSubProcesses(self.subProcesses_(), options))
1046  if len(self.subProcesses_()):
1047  sys.stderr.write("error: subprocesses are not supported yet\n\n")
1048  parts.update(self._splitPythonList('modules', self.producers_(), options))
1049  parts.update(self._splitPythonList('modules', self.switchProducers_(), options))
1050  parts.update(self._splitPythonList('modules', self.filters_() , options))
1051  parts.update(self._splitPythonList('modules', self.analyzers_(), options))
1052  parts.update(self._splitPythonList('modules', self.outputModules_(), options))
1053  parts.update(self._splitPythonList('services', self.services_(), options))
1054  parts.update(self._splitPythonList('eventsetup', self.es_producers_(), options))
1055  parts.update(self._splitPythonList('eventsetup', self.es_sources_(), options))
1056  parts.update(self._splitPython('eventsetup', self.es_prefers_(), options))
1057  parts.update(self._splitPythonList('tasks', self._itemsInDependencyOrder(self.tasks), options))
1058  parts.update(self._splitPythonList('sequences', self._itemsInDependencyOrder(self.sequences), options))
1059  parts.update(self._splitPythonList('paths', self.paths_(), options))
1060  parts.update(self._splitPythonList('paths', self.endpaths_(), options))
1061  parts.update(self._splitPythonList('paths', self.finalpaths_(), options))
1062  parts.update(self._splitPythonList('modules', self.aliases_(), options))
1063 
1064  if options.targetDirectory is not None:
1065  files[options.targetDirectory + '/__init__.py'] = ''
1066 
1067  if options.useSubdirectories:
1068  for sub in 'psets', 'modules', 'services', 'eventsetup', 'tasks', 'sequences', 'paths':
1069  if options.targetDirectory is not None:
1070  sub = options.targetDirectory + '/' + sub
1071  files[sub + '/__init__.py'] = ''
1072 
1073  # case insensitive sort by subfolder and module name
1074  parts = sorted(parts.items(), key = lambda nsc: (nsc[1][0].lower() if nsc[1][0] else '', nsc[0].lower()))
1075 
1076  for (name, (subfolder, code)) in parts:
1077  filename = name + '_cfi'
1078  if options.useSubdirectories and subfolder:
1079  filename = subfolder + '/' + filename
1080  if options.targetDirectory is not None:
1081  filename = options.targetDirectory + '/' + filename
1082  result += 'process.load("%s")\n' % filename
1083  files[filename + '.py'] = header + '\n\n' + code
1084 
1085  if self.schedule_() is not None:
1086  options.isCfg = True
1087  result += '\nprocess.schedule = ' + self.schedule.dumpPython(options)
1088 
1089  imports = specialImportRegistry.getSpecialImports()
1090  if len(imports) > 0:
1091  header += '\n' + '\n'.join(imports)
1092  files['-'] = header + '\n\n' + result
1093  return files
def es_sources_
Definition: Config.py:332
def _itemsInDependencyOrder
Definition: Config.py:919
def es_producers_
Definition: Config.py:328
def aliases_
Definition: Config.py:340
def filters_
Definition: Config.py:188
def _splitPythonList
Definition: Config.py:880
def dumpPython
Definition: Config.py:988
def es_prefers_
Definition: Config.py:336
def splitPython
Definition: Config.py:1023
def outputModules_
Definition: Config.py:281
def producers_
Definition: Config.py:199
def analyzers_
Definition: Config.py:277
def switchProducers_
Definition: Config.py:203
def services_
Definition: Config.py:324
def schedule_
Definition: Config.py:305
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def _splitPython
Definition: Config.py:982
def finalpaths_
Definition: Config.py:293
def subProcesses_
Definition: Config.py:273
def endpaths_
Definition: Config.py:289
def Config.Process.subProcesses_ (   self)
returns a list of the subProcesses that have been added to the Process

Definition at line 273 of file Config.py.

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

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

Definition at line 158 of file Config.py.

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

159  def switchProducerNames(self):
160  """Returns a string containing all the SwitchProducer labels separated by a blank"""
return ' '.join(self.switchProducers_().keys())
def switchProducerNames
Definition: Config.py:158
def switchProducers_
Definition: Config.py:203
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 203 of file Config.py.

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

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

Definition at line 301 of file Config.py.

302  def tasks_(self):
303  """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 1427 of file Config.py.

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

Definition at line 348 of file Config.py.

Referenced by Config.Process.prune().

349  def vpsets_(self):
350  """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 1363 of file Config.py.

Config.Process.__process
private

Definition at line 1364 of file Config.py.

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

Config.Process.__processPSet
private

Definition at line 1353 of file Config.py.

Config.Process.__thelist
private

Definition at line 1352 of file Config.py.

Config.Process.maxEvents

Definition at line 140 of file Config.py.

Config.Process.maxLuminosityBlocks

Definition at line 141 of file Config.py.

Config.Process.MessageLogger

Definition at line 146 of file Config.py.

Config.Process.options

Definition at line 139 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 343 of file Config.py.

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

Definition at line 280 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 292 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 339 of file Config.py.

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

Definition at line 331 of file Config.py.

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

Definition at line 335 of file Config.py.

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

Definition at line 191 of file Config.py.

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

Definition at line 296 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 218 of file Config.py.

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

Definition at line 284 of file Config.py.

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

Definition at line 288 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 198 of file Config.py.

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

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

Definition at line 202 of file Config.py.

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

Definition at line 347 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 323 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 300 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 327 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 212 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 276 of file Config.py.

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

Definition at line 206 of file Config.py.

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

Definition at line 304 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 351 of file Config.py.

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