The Gaudi Framework  v36r1 (3e2fb5a8)
testMultithreadedAlg.py
Go to the documentation of this file.
1 #!/usr/bin/env gaudirun.py
2 
12 """
13 A test for a single algorithm with internal multithreading
14 """
15 
16 from Gaudi.Configuration import *
17 from Configurables import (HiveWhiteBoard, HiveSlimEventLoopMgr, CPUCrunchSvc,
18  AvalancheSchedulerSvc, AlgResourcePool, CPUCruncher)
19 
20 evtslots = 1
21 evtMax = 1
22 cardinality = 1
23 threads = 5 # Threading within alg is still limited by total thread pool
24 
25 whiteboard = HiveWhiteBoard("EventDataSvc", EventSlots=evtslots)
26 
27 slimeventloopmgr = HiveSlimEventLoopMgr(
28  SchedulerName="AvalancheSchedulerSvc", OutputLevel=DEBUG)
29 
30 scheduler = AvalancheSchedulerSvc(ThreadPoolSize=threads, OutputLevel=VERBOSE)
31 
32 AlgResourcePool(OutputLevel=DEBUG)
33 
34 CPUCrunchSvc(shortCalib=True)
35 
36 # Set up of CPU crunchers -------------------------------------------------------
37 
38 a1 = CPUCruncher("A1")
39 a1.Cardinality = cardinality
40 a1.avgRuntime = 5.0
41 a1.NParallel = 5
42 a1.OutputLevel = DEBUG
43 
44 # Application Manager ----------------------------------------------------------
45 
47  EvtMax=evtMax,
48  EvtSel='NONE',
49  ExtSvc=[whiteboard],
50  EventLoop=slimeventloopmgr,
51  TopAlg=[a1],
52  MessageSvcType="InertMessageSvc",
53  OutputLevel=INFO)
Gaudi.Configuration
Definition: Configuration.py:1
ApplicationMgr
Definition: ApplicationMgr.h:57