ATLAS Offline Software
LinearTransformTaskExample_jobOptions.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 #
3 # "Standalone" jobOptions for running
4 # AthCUDAExamples::LinearTransformTaskExampleAlg.
5 #
6 
7 # The number of CUDA kernels to execute in parallel in the job.
8 CUDAKernelsInFlight = 5
9 
10 # Set up the service(s) needed by the job.
11 from AthenaCommon.AppMgr import ServiceMgr
12 ServiceMgr += CfgMgr.AthCUDA__StreamPoolSvc( "CUDAStreamPoolSvc",
13  NStreams = CUDAKernelsInFlight )
14 ServiceMgr += CfgMgr.AthCUDA__KernelRunnerSvc( "CUDAKernelRunnerSvc",
15  StreamPoolSvc = ServiceMgr.CUDAStreamPoolSvc,
16  NParallelKernels = CUDAKernelsInFlight )
17 
18 # Set up / access the algorithm sequence.
19 from AthenaCommon.AlgSequence import AlgSequence
20 algSequence = AlgSequence()
21 
22 # Add the algorithm to the sequence.
23 from AthExCUDA.AthExCUDAConf import \
24  AthCUDAExamples__LinearTransformTaskExampleAlg
25 algSequence += AthCUDAExamples__LinearTransformTaskExampleAlg(
26  KernelRunnerSvc = ServiceMgr.CUDAKernelRunnerSvc )
27 
28 # Run for some larger number of events.
29 theApp.EvtMax = 10000
30 
31 # Set up the avalanche scheduler correctly, in case we are running with multiple
32 # threads.
33 from AthenaCommon.ConcurrencyFlags import jobproperties
34 if jobproperties.ConcurrencyFlags.NumThreads() != 0:
35  from AthenaCommon.AlgScheduler import AlgScheduler
36  AlgScheduler.SchedulerSvc.PreemptiveBlockingTasks = True
37  AlgScheduler.SchedulerSvc.MaxBlockingAlgosInFlight = CUDAKernelsInFlight
38  pass
39 
40 # Set the event printout interval.
41 if not hasattr( ServiceMgr, theApp.EventLoop ):
42  ServiceMgr += getattr( CfgMgr, theApp.EventLoop )()
43  pass
44 evtLoop = getattr( ServiceMgr, theApp.EventLoop )
45 evtLoop.EventPrintoutInterval = 1000
python.AlgSequence.AlgSequence
AlgSequence
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py:7