ATLAS Offline Software
Loading...
Searching...
No Matches
LinearTransformAsyncExampleConfig.py
Go to the documentation of this file.
1#!/usr/bin/env python3
2# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3#
4# Simple ComponentAccumulator configuration for running
5# AthCUDAExamples::LinearTransformAsyncExampleAlg#
6
7# Core import(s).
8from AthenaConfiguration.AllConfigFlags import initConfigFlags
9from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
10from AthenaConfiguration.ComponentFactory import CompFactory
11from AthenaConfiguration.MainServicesConfig import MainServicesCfg
12from AthenaConfiguration.TestDefaults import defaultTestFiles
13
14# I/O import(s).
15from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
16
17# System import(s).
18import sys
19
21 '''Configure the example algorithm for running on a CUDA device.
22 '''
23 # Create an accumulator to hold the configuration.
24 result = ComponentAccumulator()
25 # Create the example algorithm.
26 alg = CompFactory.AthCUDAExamples.LinearTransformAsyncExampleAlg(**kwargs)
27 result.addEventAlgo(alg)
28 # Return the result to the caller.
29 return result
30
31if __name__ == '__main__':
32
33 # Set up the job's flags.
34 flags = initConfigFlags()
35 flags.Concurrency.NumOffloadThreads = 2
36 flags.Exec.MaxEvents = 10000
37 flags.Input.Files = defaultTestFiles.AOD_RUN3_DATA
38 flags.fillFromArgs()
39 flags.lock()
40
41 # Set up the main services.
42 acc = MainServicesCfg(flags)
43
44 # Set up the input file reading.
45 acc.merge(PoolReadCfg(flags))
46
47 # Set up the example algorithm.
48 acc.merge(LinearTransformAsyncExampleAlgCfg(flags))
49
50 # Run the configuration.
51 sys.exit(acc.run().isFailure())