CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ProcessAcceleratorAlpaka.ProcessAcceleratorAlpaka Class Reference
Inheritance diagram for ProcessAcceleratorAlpaka.ProcessAcceleratorAlpaka:

Public Member Functions

def __init__ (self)
 
def apply (self, process, accelerators)
 
def moduleTypeResolver (self, accelerators)
 
def setBackend (self, backend)
 

Private Attributes

 _backend
 

Detailed Description

ProcessAcceleratorAlpaka itself does not define or inspect
availability of any accelerator devices. It merely sets up
necessary Alpaka infrastructure based on the availability of
accelerators that the concrete ProcessAccelerators (like
ProcessAcceleratorCUDA) define.

Definition at line 46 of file ProcessAcceleratorAlpaka.py.

Constructor & Destructor Documentation

◆ __init__()

def ProcessAcceleratorAlpaka.ProcessAcceleratorAlpaka.__init__ (   self)

Definition at line 53 of file ProcessAcceleratorAlpaka.py.

53  def __init__(self):
54  super(ProcessAcceleratorAlpaka, self).__init__()
55  self._backend = None
56 
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

◆ apply()

def ProcessAcceleratorAlpaka.ProcessAcceleratorAlpaka.apply (   self,
  process,
  accelerators 
)

Definition at line 65 of file ProcessAcceleratorAlpaka.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__().

65  def apply(self, process, accelerators):
66  # Propagate the AlpakaService messages through the MessageLogger
67  if not hasattr(process.MessageLogger, "AlpakaService"):
68  process.MessageLogger.AlpakaService = cms.untracked.PSet()
69 
70  # Check if the CPU backend is available
71  try:
72  if not "cpu" in accelerators:
73  raise False
74  from HeterogeneousCore.AlpakaServices.AlpakaServiceSerialSync_cfi import AlpakaServiceSerialSync
75  except:
76  # the CPU backend is not available, do not load the AlpakaServiceSerialSync
77  if hasattr(process, "AlpakaServiceSerialSync"):
78  del process.AlpakaServiceSerialSync
79  else:
80  # the CPU backend is available, ensure the AlpakaServiceSerialSync is loaded
81  if not hasattr(process, "AlpakaServiceSerialSync"):
82  process.add_(AlpakaServiceSerialSync)
83 
84  # Check if CUDA is available, and if the system has at least one usable NVIDIA GPU
85  try:
86  if not "gpu-nvidia" in accelerators:
87  raise False
88  from HeterogeneousCore.AlpakaServices.AlpakaServiceCudaAsync_cfi import AlpakaServiceCudaAsync
89  except:
90  # CUDA is not available, do not load the AlpakaServiceCudaAsync
91  if hasattr(process, "AlpakaServiceCudaAsync"):
92  del process.AlpakaServiceCudaAsync
93  else:
94  # CUDA is available, ensure the AlpakaServiceCudaAsync is loaded
95  if not hasattr(process, "AlpakaServiceCudaAsync"):
96  process.add_(AlpakaServiceCudaAsync)
97 
98  # Check if ROCm is available, and if the system has at least one usable AMD GPU
99  try:
100  if not "gpu-amd" in accelerators:
101  raise False
102  from HeterogeneousCore.AlpakaServices.AlpakaServiceROCmAsync_cfi import AlpakaServiceROCmAsync
103  except:
104  # ROCm is not available, do not load the AlpakaServiceROCmAsync
105  if hasattr(process, "AlpakaServiceROCmAsync"):
106  del process.AlpakaServiceROCmAsync
107  else:
108  # ROCm is available, ensure the AlpakaServiceROCmAsync is loaded
109  if not hasattr(process, "AlpakaServiceROCmAsync"):
110  process.add_(AlpakaServiceROCmAsync)
111 
112 
113 # Ensure this module is kept in the configuration when dumping it
114 cms.specialImportRegistry.registerSpecialImportForType(ProcessAcceleratorAlpaka, "from HeterogeneousCore.AlpakaCore.ProcessAcceleratorAlpaka import ProcessAcceleratorAlpaka")
115 
Vec apply(Vec v, F f)
Definition: ExtVec.h:81

◆ moduleTypeResolver()

def ProcessAcceleratorAlpaka.ProcessAcceleratorAlpaka.moduleTypeResolver (   self,
  accelerators 
)

Definition at line 62 of file ProcessAcceleratorAlpaka.py.

References ProcessAcceleratorAlpaka.ProcessAcceleratorAlpaka._backend.

62  def moduleTypeResolver(self, accelerators):
63  return ModuleTypeResolverAlpaka(accelerators, self._backend)
64 

◆ setBackend()

def ProcessAcceleratorAlpaka.ProcessAcceleratorAlpaka.setBackend (   self,
  backend 
)

Definition at line 58 of file ProcessAcceleratorAlpaka.py.

References ProcessAcceleratorAlpaka.ProcessAcceleratorAlpaka._backend.

58  def setBackend(self, backend):
59  self._backend = backend
60 

Member Data Documentation

◆ _backend

ProcessAcceleratorAlpaka.ProcessAcceleratorAlpaka._backend
private