ATLAS Offline Software
LinearTransformTaskExample_jobOptions.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2020 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  Blocking = True )
28 
29 # Run for some larger number of events.
30 theApp.EvtMax = 10000
31 
32 # Set up the avalanche scheduler correctly, in case we are running with multiple
33 # threads.
34 from AthenaCommon.ConcurrencyFlags import jobproperties
35 if jobproperties.ConcurrencyFlags.NumThreads() != 0:
36  from AthenaCommon.AlgScheduler import AlgScheduler
37  AlgScheduler.SchedulerSvc.PreemptiveBlockingTasks = True
38  AlgScheduler.SchedulerSvc.MaxBlockingAlgosInFlight = CUDAKernelsInFlight
39  pass
40 
41 # Set the event printout interval.
42 if not hasattr( ServiceMgr, theApp.EventLoop ):
43  ServiceMgr += getattr( CfgMgr, theApp.EventLoop )()
44  pass
45 evtLoop = getattr( ServiceMgr, theApp.EventLoop )
46 evtLoop.EventPrintoutInterval = 1000
python.AlgSequence.AlgSequence
AlgSequence
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py:7