The Gaudi Framework
master (53dee381)
Toggle main menu visibility
Loading...
Searching...
No Matches
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 = 3.0
48
a1.NParallel = 5
49
a1.OutputLevel = DEBUG
50
51
# Application Manager ----------------------------------------------------------
52
53
ApplicationMgr
(
54
EvtMax=evtMax,
55
EvtSel=
"NONE"
,
56
ExtSvc=[whiteboard],
57
EventLoop=slimeventloopmgr,
58
TopAlg=[a1],
59
MessageSvcType=
"InertMessageSvc"
,
60
OutputLevel=INFO,
61
)
AlgResourcePool
The AlgResourcePool is a concrete implementation of the IAlgResourcePool interface.
Definition
AlgResourcePool.h:35
ApplicationMgr
The Application Manager class.
Definition
ApplicationMgr.h:54
AvalancheSchedulerSvc
Definition
AvalancheSchedulerSvc.h:114
CPUCrunchSvc
Definition
CPUCrunchSvc.h:22
CPUCruncher
A class that implements a search for prime numbers.
Definition
CPUCruncher.h:30
HiveSlimEventLoopMgr
Definition
HiveSlimEventLoopMgr.h:31
HiveWhiteBoard
Data service base class.
Definition
HiveWhiteBoard.cpp:100
Gaudi.Configuration
Definition
Configuration.py:1
GaudiHive
options
testMultithreadedAlg.py
Generated on
for The Gaudi Framework by
1.17.0