CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions | Private Member Functions
Config.ProcessAccelerator Class Reference
Inheritance diagram for Config.ProcessAccelerator:
Mixins._ConfigureComponent Mixins._Unlabelable Config.ProcessAcceleratorTest Config.ProcessAcceleratorTest2

Public Member Functions

def __init__ (self)
 
def apply (self, process, accelerators)
 
def dumpPython (self, options=PrintOptions())
 
def dumpPythonImpl (self, options)
 
def enabledLabels (self)
 
def labels (self)
 
def moduleTypeResolver (self, accelerators)
 
def type_ (self)
 

Private Member Functions

def _place (self, name, proc)
 

Detailed Description

A class used to specify possible compute accelerators in a Process
instance. It is intended to be derived for any
accelerator/portability technology, and provides hooks such that a
specific customization can be applied to the Process on a worker
node at the point where the python configuration is serialized for C++.

The customization must not change the configuration hash. To
enforce this reuirement, the customization gets a
ProcessForProcessAccelerator wrapper that gives access to only
those parts of the configuration that can be changed. Nevertheless
it would be good to have specific unit test for each deriving
class to ensure that all combinations of the enabled accelerators
give the same configuration hash.

The deriving class must do its checks for hardware availability
only in enabledLabels(), and possibly in apply() if any further
fine-tuning is needed, because those two are the only functions
that are guaranteed to be called at the worker node.

Definition at line 1983 of file Config.py.

Constructor & Destructor Documentation

◆ __init__()

def Config.ProcessAccelerator.__init__ (   self)

Definition at line 2003 of file Config.py.

2003  def __init__(self):
2004  pass
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)

Member Function Documentation

◆ _place()

def Config.ProcessAccelerator._place (   self,
  name,
  proc 
)
private

Definition at line 2005 of file Config.py.

2005  def _place(self, name, proc):
2006  proc._placeAccelerator(self.type_(), self)

◆ apply()

def Config.ProcessAccelerator.apply (   self,
  process,
  accelerators 
)
Override if need to customize the Process at worker node. The
selected available accelerator labels are given in the
'accelerators' argument (the patterns, e.g. '*' have been
expanded to concrete labels).

This function may touch only untracked parameters.

Definition at line 2046 of file Config.py.

Referenced by heavyIonTools.ConfigureHeavyIons.__call__(), coreTools.RunOnData.__call__(), trackTools.MakeAODTrackCandidates.__call__(), runJetUncertainties.RunJetUncertainties.__call__(), metTools.AddMETCollection.__call__(), heavyIonTools.ProductionDefaults.__call__(), cmsswVersionTools.PickRelValInputFiles.__call__(), coreTools.RemoveMCMatching.__call__(), trackTools.MakePATTrackCandidates.__call__(), trigTools.SwitchOnTrigger.__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__call__(), heavyIonTools.SelectionDefaults.__call__(), heavyIonTools.DisbaleMonteCarloDeps.__call__(), trigTools.SwitchOnTriggerStandAlone.__call__(), tauTools.AddTauCollection.__call__(), trackTools.MakeTrackCandidates.__call__(), trigTools.SwitchOnTriggerMatching.__call__(), trigTools.SwitchOnTriggerMatchingStandAlone.__call__(), trigTools.SwitchOnTriggerMatchEmbedding.__call__(), jetTools.AddJetCollection.__call__(), jetTools.SwitchJetCollection.__call__(), jetTools.UpdateJetCollection.__call__(), jetTools.AddJetID.__call__(), and jetTools.SetTagInfos.__call__().

2046  def apply(self, process, accelerators):
2047  """Override if need to customize the Process at worker node. The
2048  selected available accelerator labels are given in the
2049  'accelerators' argument (the patterns, e.g. '*' have been
2050  expanded to concrete labels).
2051 
2052  This function may touch only untracked parameters.
2053  """
2054  pass
2055 
Vec apply(Vec v, F f)
Definition: ExtVec.h:77

◆ dumpPython()

def Config.ProcessAccelerator.dumpPython (   self,
  options = PrintOptions() 
)

Definition at line 2009 of file Config.py.

References __class__< T >.__class__(), and Config.ProcessAccelerator.dumpPythonImpl().

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__(), and SequenceTypes.Schedule.__str__().

2009  def dumpPython(self, options=PrintOptions()):
2010  specialImportRegistry.registerUse(self)
2011  result = self.__class__.__name__+"(" # not including cms. since the deriving classes are not in cms "namespace"
2012  options.indent()
2013  res = self.dumpPythonImpl(options)
2014  options.unindent()
2015  if len(res) > 0:
2016  result += "\n"+res+"\n"
2017  result += ")\n"
2018  return result
2019 
def dumpPython(process, name)

◆ dumpPythonImpl()

def Config.ProcessAccelerator.dumpPythonImpl (   self,
  options 
)
Override if need to add any 'body' content to dumpPython(). Returns a string.

Definition at line 2021 of file Config.py.

Referenced by Config.ProcessAccelerator.dumpPython().

2021  def dumpPythonImpl(self, options):
2022  """Override if need to add any 'body' content to dumpPython(). Returns a string."""
2023  return ""

◆ enabledLabels()

def Config.ProcessAccelerator.enabledLabels (   self)
Override to return a list of strings for the accelerator labels
that are enabled in the system the job is being run on.

Definition at line 2027 of file Config.py.

2027  def enabledLabels(self):
2028  """Override to return a list of strings for the accelerator labels
2029  that are enabled in the system the job is being run on."""
2030  return []

◆ labels()

def Config.ProcessAccelerator.labels (   self)
Override to return a list of strings for the accelerator labels.

Definition at line 2024 of file Config.py.

Referenced by ProcessAcceleratorCUDA.ProcessAcceleratorCUDA.enabledLabels(), and ProcessAcceleratorROCm.ProcessAcceleratorROCm.enabledLabels().

2024  def labels(self):
2025  """Override to return a list of strings for the accelerator labels."""
2026  return []

◆ moduleTypeResolver()

def Config.ProcessAccelerator.moduleTypeResolver (   self,
  accelerators 
)
Override to return an object that implements "module type resolver"
in python. The object should have the following methods
- __init__(self, accelerators)
  * accelerators = list of selected accelerators
- plugin(self):
  * should return a string for the type resolver plugin name
- setModuleVariant(self, module):
  * Called for each ED and ES module. Should act only if
    module.type_() contains the magic identifier

At most one of the ProcessAccelerators in a job can return a
non-None object

Definition at line 2031 of file Config.py.

2031  def moduleTypeResolver(self, accelerators):
2032  """Override to return an object that implements "module type resolver"
2033  in python. The object should have the following methods
2034  - __init__(self, accelerators)
2035  * accelerators = list of selected accelerators
2036  - plugin(self):
2037  * should return a string for the type resolver plugin name
2038  - setModuleVariant(self, module):
2039  * Called for each ED and ES module. Should act only if
2040  module.type_() contains the magic identifier
2041 
2042  At most one of the ProcessAccelerators in a job can return a
2043 non-None object
2044  """
2045  return None

◆ type_()

def Config.ProcessAccelerator.type_ (   self)