Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-05-12 02:41:09

0001 import FWCore.ParameterSet.Config as cms
0002 from HeterogeneousCore.CUDACore.SwitchProducerCUDA import SwitchProducerCUDA
0003 
0004 # ECAL unpacker running on CPU
0005 from EventFilter.EcalRawToDigi.EcalUnpackerData_cfi import ecalEBunpacker as _ecalEBunpacker
0006 ecalDigis = SwitchProducerCUDA(
0007     cpu = _ecalEBunpacker.clone()
0008 )
0009 
0010 ecalDigisTask = cms.Task(
0011     # ECAL unpacker running on CPU
0012     ecalDigis
0013 )
0014 
0015 # process modifier to run on GPUs
0016 from Configuration.ProcessModifiers.gpu_cff import gpu
0017 
0018 # ECAL conditions used by the unpacker running on GPU
0019 from EventFilter.EcalRawToDigi.ecalElectronicsMappingGPUESProducer_cfi import ecalElectronicsMappingGPUESProducer
0020 
0021 # ECAL unpacker running on GPU
0022 from EventFilter.EcalRawToDigi.ecalRawToDigiGPU_cfi import ecalRawToDigiGPU as _ecalRawToDigiGPU
0023 ecalDigisGPU = _ecalRawToDigiGPU.clone()
0024 
0025 # disable the ECAL unpacker collections that are not available in the GPU unpacker
0026 gpu.toModify(ecalDigis.cpu,
0027     headerUnpacking = False,
0028     memUnpacking = False
0029 )
0030 
0031 # extend the SwitchProducer to add a case to copy the ECAL digis from GPU to CPU and covert them from SoA to legacy format
0032 from EventFilter.EcalRawToDigi.ecalCPUDigisProducer_cfi import ecalCPUDigisProducer as _ecalCPUDigisProducer
0033 gpu.toModify(ecalDigis,
0034     # copy the ECAL digis from GPU to CPU and covert them from SoA to legacy format
0035     cuda = _ecalCPUDigisProducer.clone(
0036         digisInLabelEB = ('ecalDigisGPU', 'ebDigis'),
0037         digisInLabelEE = ('ecalDigisGPU', 'eeDigis'),
0038         produceDummyIntegrityCollections = True
0039     )
0040 )
0041 
0042 gpu.toReplaceWith(ecalDigisTask, cms.Task(
0043     # ECAL conditions used by the unpacker running on GPU
0044     ecalElectronicsMappingGPUESProducer,
0045     # run the ECAL unpacker on GPU
0046     ecalDigisGPU,
0047     # run the ECAL unpacker on CPU, or copy the ECAL digis from GPU to CPU and covert them from SoA to legacy format
0048     ecalDigis
0049 ))