Skip to content

Commit

Permalink
Reco running only on CPU bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub-Gajownik committed Jan 17, 2025
1 parent cd6c8e0 commit 6773b00
Showing 1 changed file with 24 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,29 +1,49 @@
import FWCore.ParameterSet.Config as cms
from HeterogeneousCore.CUDACore.SwitchProducerCUDA import SwitchProducerCUDA

# ECAL Phase 2 weights running on CPU
from RecoLocalCalo.EcalRecProducers.ecalUncalibRecHitPhase2_cfi import ecalUncalibRecHitPhase2 as _ecalUncalibRecHitPhase2
ecalUncalibRecHitPhase2CPU = _ecalUncalibRecHitPhase2.clone()
ecalUncalibRecHitPhase2 = SwitchProducerCUDA(
cpu = ecalUncalibRecHitPhase2CPU
)

ecalUncalibRecHitPhase2Task = cms.Task(
# ECAL weights running on CPU
ecalUncalibRecHitPhase2
)


from Configuration.StandardSequences.Accelerators_cff import *

# process modifier to run alpaka implementation
from Configuration.ProcessModifiers.alpaka_cff import alpaka

#ECAL Phase 2 Digis Producer running on the accelerator
from RecoLocalCalo.EcalRecProducers.ecalPhase2DigiToPortableProducer_cfi import ecalPhase2DigiToPortableProducer as _ecalPhase2DigiToPortableProducer
ecalPhase2DigiToPortableProducer = _ecalPhase2DigiToPortableProducer.clone()

# portable weights
# ECAL Phase 2 weights portable running
from RecoLocalCalo.EcalRecProducers.ecalUncalibRecHitPhase2Portable_cfi import ecalUncalibRecHitPhase2Portable as _ecalUncalibRecHitPhase2Portable
ecalUncalibRecHitPhase2Portable = _ecalUncalibRecHitPhase2Portable.clone(
digisLabelEB = 'ecalPhase2DigiToPortableProducer:ebDigis'
)

from RecoLocalCalo.EcalRecProducers.ecalUncalibRecHitSoAToLegacy_cfi import ecalUncalibRecHitSoAToLegacy as _ecalUncalibRecHitSoAToLegacy
ecalUncalibRecHitPhase2 = _ecalUncalibRecHitSoAToLegacy.clone(
alpaka.toModify(ecalUncalibRecHitPhase2,
cpu = _ecalUncalibRecHitSoAToLegacy.clone(),
isPhase2 = True,
uncalibRecHitsPortableEB = 'ecalUncalibRecHitPhase2Portable:EcalUncalibRecHitsEB',
uncalibRecHitsPortableEE = None,
recHitsLabelCPUEE = None
)


ecalUncalibRecHitPhase2Task = cms.Task(
alpaka.toReplaceWith(ecalUncalibRecHitPhase2Task, cms.Task(
# convert phase2 digis to Portable Collection
ecalPhase2DigiToPortableProducer,
# ECAL weights running on Portable
ecalUncalibRecHitPhase2Portable,
# Convert the uncalibrated rechits from Portable Collection to legacy format
ecalUncalibRecHitPhase2
)
))

0 comments on commit 6773b00

Please sign in to comment.