From 2659399df4bb61f05cd0041255285ee2f8ff05a8 Mon Sep 17 00:00:00 2001 From: Manos Vourliotis Date: Wed, 18 Oct 2023 08:41:19 -0700 Subject: [PATCH] Update BuildFile to load both CPU and GPU standalone libraries and update to latest alpaka interface --- .../python/HighPtTripletStep_cff.py | 13 ++++++------- RecoTracker/LST/plugins/BuildFile.xml | 19 ++++++++++++++++--- RecoTracker/LST/test/LSTAlpakaTester.py | 13 +++---------- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py b/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py index 226130e00819d..dd2050f33e099 100644 --- a/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py +++ b/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py @@ -387,14 +387,13 @@ from RecoTracker.LST.lstSeedTracks_cfi import lstInitialStepSeedTracks,lstHighPtTripletStepSeedTracks from RecoTracker.LST.lstPixelSeedInputProducer_cfi import lstPixelSeedInputProducer from RecoTracker.LST.lstPhase2OTHitsInputProducer_cfi import lstPhase2OTHitsInputProducer -from RecoTracker.LST.alpaka_cuda_asyncLSTProducer_cfi import alpaka_cuda_asyncLSTProducer -from RecoTracker.LST.alpaka_serial_syncLSTProducer_cfi import alpaka_serial_syncLSTProducer -from Configuration.ProcessModifiers.gpu_cff import gpu -from HeterogeneousCore.CUDACore.SwitchProducerCUDA import SwitchProducerCUDA -lstProducer = SwitchProducerCUDA( - cpu = alpaka_serial_syncLSTProducer.clone(), +from RecoTracker.LST.lstProducer_cfi import lstProducer as _lstProducer +# Define lstProducer like this to be able to run the serial version explicitly +lstProducer = _lstProducer.clone( + alpaka = cms.untracked.PSet(backend = cms.untracked.string('serial_sync')) ) -gpu.toModify(lstProducer,cuda = alpaka_cuda_asyncLSTProducer.clone()) +from Configuration.ProcessModifiers.gpu_cff import gpu +gpu.toReplaceWith(lstProducer,_lstProducer.clone()) _HighPtTripletStepTask_LST.add(siPhase2RecHits, lstInitialStepSeedTracks, lstHighPtTripletStepSeedTracks, lstPixelSeedInputProducer, lstPhase2OTHitsInputProducer, lstProducer) (trackingPhase2PU140 & trackingLST).toReplaceWith(HighPtTripletStepTask, _HighPtTripletStepTask_LST) diff --git a/RecoTracker/LST/plugins/BuildFile.xml b/RecoTracker/LST/plugins/BuildFile.xml index 3d58472286196..35792f68d0b21 100644 --- a/RecoTracker/LST/plugins/BuildFile.xml +++ b/RecoTracker/LST/plugins/BuildFile.xml @@ -22,15 +22,28 @@ - + - + - + + + + + + + + + + + + + + diff --git a/RecoTracker/LST/test/LSTAlpakaTester.py b/RecoTracker/LST/test/LSTAlpakaTester.py index 8777b070a7e22..1893e0c62a26e 100644 --- a/RecoTracker/LST/test/LSTAlpakaTester.py +++ b/RecoTracker/LST/test/LSTAlpakaTester.py @@ -90,16 +90,9 @@ # Main LST Producer process.load('Configuration.StandardSequences.Accelerators_cff') -process.load('RecoTracker.LST.alpaka_cuda_asyncLSTProducer_cfi') -process.load('RecoTracker.LST.alpaka_serial_syncLSTProducer_cfi') -### Enable alpaka-based heterogeneous modules -process.AlpakaServiceCudaAsync = cms.Service('AlpakaServiceCudaAsync') -process.AlpakaServiceSerialSync = cms.Service('AlpakaServiceSerialSync') -from HeterogeneousCore.CUDACore.SwitchProducerCUDA import SwitchProducerCUDA -process.lstProducer = SwitchProducerCUDA( - cpu = process.alpaka_serial_syncLSTProducer.clone(), - cuda = process.alpaka_cuda_asyncLSTProducer.clone() -) +process.load("HeterogeneousCore.AlpakaCore.ProcessAcceleratorAlpaka_cfi") +from RecoTracker.LST.lstProducer_cfi import lstProducer as _lstProducer +process.lstProducer = _lstProducer.clone() # Track Fitting import RecoTracker.TrackProducer.TrackProducer_cfi