ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaExamples
AthExCUDA
python
TrackParticleCalibratorExampleConfig.py
Go to the documentation of this file.
1
#!/usr/bin/env athena.py
2
#
3
# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
4
#
5
# Simple ComponentAccumulator configuration for running
6
# AthCUDAExamples::TrackParticleCalibratorExampleAlg, offloading trivial
7
# operations on xAOD::TrackParticleContrinaer, to a CUDA device.
8
#
9
10
# Core import(s).
11
from
AthenaConfiguration.AllConfigFlags
import
initConfigFlags
12
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
13
from
AthenaConfiguration.ComponentFactory
import
CompFactory
14
from
AthenaConfiguration.MainServicesConfig
import
MainServicesCfg
15
from
AthenaConfiguration.TestDefaults
import
defaultTestFiles
16
from
AthenaCommon.Constants
import
DEBUG
17
18
# I/O import(s).
19
from
AthenaPoolCnvSvc.PoolReadConfig
import
PoolReadCfg
20
21
# Device/Accelerator import(s).
22
from
AthDeviceComps.AthDeviceCompsConfig
import
HostCopyToolCfg
23
from
AthCUDAServices.AthCUDAServicesConfig
import
\
24
MemoryResourcesToolCfg, StreamToolCfg
25
from
AthCUDAServices.AthCUDAServicesConfig
import
AsyncCopyToolCfg
as
DeviceCopyToolCfg
26
27
# System import(s).
28
import
sys
29
30
def
TrackParticleCalibratorExampleAlgCfg
(flags, **kwargs):
31
'''Configure the example algorithm for running on a CUDA device.
32
'''
33
# Create an accumulator to hold the configuration.
34
result = ComponentAccumulator()
35
# Create the example algorithm.
36
alg = CompFactory.AthCUDAExamples.TrackParticleCalibratorExampleAlg(**kwargs)
37
memoryResources = MemoryResourcesToolCfg(flags, **kwargs)
38
alg.MemoryResourcesTool = memoryResources.getPrimary()
39
result.merge(memoryResources)
40
hostCopyTool = HostCopyToolCfg(flags, **kwargs)
41
alg.HostCopyTool = hostCopyTool.getPrimary()
42
result.merge(hostCopyTool)
43
deviceCopyTool = DeviceCopyToolCfg(flags, **kwargs)
44
alg.DeviceCopyTool = deviceCopyTool.getPrimary()
45
result.merge(deviceCopyTool)
46
streamTool = StreamToolCfg(flags, **kwargs)
47
alg.StreamTool = streamTool.getPrimary()
48
result.merge(streamTool)
49
50
# Add the algorithm to the accumulator, so that it would eventually be
51
# scheduled to run.
52
result.addEventAlgo(alg)
53
# Return the result to the caller.
54
return
result
55
56
if
__name__ ==
'__main__'
:
57
58
# Set up the job's flags.
59
flags = initConfigFlags()
60
flags.Exec.MaxEvents = 100
61
flags.Input.Files = defaultTestFiles.AOD_RUN3_DATA
62
flags.fillFromArgs()
63
flags.lock()
64
65
# Set up the main services.
66
acc = MainServicesCfg(flags)
67
68
# Set up the input file reading.
69
acc.merge(PoolReadCfg(flags))
70
71
# Set up the example algorithm.
72
acc.merge(
TrackParticleCalibratorExampleAlgCfg
(flags, OutputLevel = DEBUG))
73
74
# Run the configuration.
75
sys.exit(acc.run().isFailure())
Constants
TrackParticleCalibratorExampleConfig.TrackParticleCalibratorExampleAlgCfg
TrackParticleCalibratorExampleAlgCfg(flags, **kwargs)
Definition
TrackParticleCalibratorExampleConfig.py:30
Generated on
for ATLAS Offline Software by
1.17.0