Skip to content

Commit

Permalink
Customise the GPU checks to use the AlpakaBackendFilter
Browse files Browse the repository at this point in the history
Customise the Status_On{CPU|GPU} HLT paths and the
DQM_{Ecal|Hcal|Pixel}Reconstruction HLT paths to use the AlpakaBackendProducer
and AlpakaBackendFilter modules.
  • Loading branch information
fwyzard committed Mar 17, 2024
1 parent f2a1c09 commit 378fb2e
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions HLTrigger/Configuration/python/customizeHLTforAlpaka.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import FWCore.ParameterSet.Config as cms

from HeterogeneousCore.AlpakaCore.functions import *

from HLTrigger.Configuration.common import producers_by_type
from HLTrigger.Configuration.common import *

## PF HLT in Alpaka
def customizeHLTforAlpakaParticleFlowClustering(process):
Expand Down Expand Up @@ -270,6 +269,7 @@ def replaceItemsInSequence(process, seqNames, itemsToReplace, replacingSequence)

return process


## Pixel HLT in Alpaka
def customizeHLTforDQMGPUvsCPUPixel(process):
'''Ad-hoc changes to test HLT config containing only DQM_PixelReconstruction_v and DQMGPUvsCPU stream
Expand Down Expand Up @@ -387,6 +387,7 @@ def customizeHLTforDQMGPUvsCPUPixel(process):

return process


def customizeHLTforAlpakaPixelRecoLocal(process):
'''Customisation to introduce the Local Pixel Reconstruction in Alpaka
'''
Expand Down Expand Up @@ -629,6 +630,7 @@ def customizeHLTforAlpakaPixelRecoLocal(process):

return process


def customizeHLTforAlpakaPixelRecoTracking(process):
'''Customisation to introduce the Pixel-Track Reconstruction in Alpaka
'''
Expand Down Expand Up @@ -745,6 +747,7 @@ def customizeHLTforAlpakaPixelRecoTracking(process):

return process


def customizeHLTforAlpakaPixelRecoVertexing(process):
'''Customisation to introduce the Pixel-Vertex Reconstruction in Alpaka
'''
Expand Down Expand Up @@ -833,6 +836,7 @@ def customizeHLTforAlpakaPixelRecoVertexing(process):

return process


def customizeHLTforAlpakaPixelReco(process):
'''Customisation to introduce the Pixel Local+Track+Vertex Reconstruction in Alpaka
'''
Expand All @@ -843,6 +847,7 @@ def customizeHLTforAlpakaPixelReco(process):

return process


## ECAL HLT in Alpaka
def customizeHLTforAlpakaEcalLocalReco(process):

Expand Down Expand Up @@ -1051,10 +1056,35 @@ def customizeHLTforAlpakaEcalLocalReco(process):

return process

def customizeHLTforAlpaka(process):

def customizeHLTforAlpakaStatus(process):

if not hasattr(process, 'statusOnGPU'):
return process

process.hltBackend = cms.EDProducer('AlpakaBackendProducer@alpaka')

insert_modules_before(process, process.statusOnGPU, process.hltBackend)

del process.statusOnGPU

process.hltStatusOnGPUFilter = cms.EDFilter('AlpakaBackendFilter',
producer = cms.InputTag('hltBackend', 'backend'),
backends = cms.vstring('CudaAsync', 'ROCmAsync')
)

insert_modules_before(process, process.statusOnGPUFilter, process.hltStatusOnGPUFilter)
insert_modules_before(process, ~process.statusOnGPUFilter, ~process.hltStatusOnGPUFilter)

del process.statusOnGPUFilter

return process


def customizeHLTforAlpaka(process):
process.load('Configuration.StandardSequences.Accelerators_cff')

process = customizeHLTforAlpakaStatus(process)
process = customizeHLTforAlpakaPixelReco(process)
process = customizeHLTforAlpakaEcalLocalReco(process)
process = customizeHLTforAlpakaParticleFlowClustering(process)
Expand Down

0 comments on commit 378fb2e

Please sign in to comment.