The Gaudi Framework  master (37c0b60a)
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 Configurables import (
17  AlgResourcePool,
18  AvalancheSchedulerSvc,
19  CPUCruncher,
20  CPUCrunchSvc,
21  HiveSlimEventLoopMgr,
22  HiveWhiteBoard,
23 )
24 from Gaudi.Configuration import *
25 
26 evtslots = 1
27 evtMax = 1
28 cardinality = 1
29 threads = 5 # Threading within alg is still limited by total thread pool
30 
31 whiteboard = HiveWhiteBoard("EventDataSvc", EventSlots=evtslots)
32 
33 slimeventloopmgr = HiveSlimEventLoopMgr(
34  SchedulerName="AvalancheSchedulerSvc", OutputLevel=DEBUG
35 )
36 
37 scheduler = AvalancheSchedulerSvc(ThreadPoolSize=threads, OutputLevel=VERBOSE)
38 
39 AlgResourcePool(OutputLevel=DEBUG)
40 
41 CPUCrunchSvc(shortCalib=True)
42 
43 # Set up of CPU crunchers -------------------------------------------------------
44 
45 a1 = CPUCruncher("A1")
46 a1.Cardinality = cardinality
47 a1.avgRuntime = 5.0
48 a1.NParallel = 5
49 a1.OutputLevel = DEBUG
50 
51 # Application Manager ----------------------------------------------------------
52 
54  EvtMax=evtMax,
55  EvtSel="NONE",
56  ExtSvc=[whiteboard],
57  EventLoop=slimeventloopmgr,
58  TopAlg=[a1],
59  MessageSvcType="InertMessageSvc",
60  OutputLevel=INFO,
61 )
Gaudi.Configuration
Definition: Configuration.py:1
ApplicationMgr
Definition: ApplicationMgr.h:57