13Reference optionfile which shows in a simple way how to take advantage of the
14Gaudi components desicated to concurrency.
16 o HiveWhiteBoard: a convenient way to collect several TES (one per "processing
17 slot"), accessible in a thread safe way, keeps a catalogue of the products
18 written on each processing slot. The number of slots in the whiteboard
19 determines also the number of events processed simultaneously by the scheduler.
20 o AvalancheSchedulerSvc: state machine of the algorithms interfaced with the
21 TBB runtime. It is responsible for the submission of the algorithms. An
22 algorithm is marked ready for submission when its needed input is available.
23 It deals the asynchronous termination of algorithms with a "receiver" thread
24 and a thread safe queue.
25 o HiveSlimEventLoopMgr: an event factory. Pushes new events and pops finished
26 events to/from the scheduler. It does not manage algorithms/streams.
27 o AlgResourcePool: Service managing the creation of algorithms (through the
28 algorithm manager), including clones. It also manages the algorithms according
29 to the resources they need.
30 o InertMessageSvc: as the TBBMsgSvc, it manages the printing of the messages in
31 a multithreaded environment.
33The CPUCruncher is not a component dealing with concurrency, but a useful
34entity to test it. It's an algorithm that simply wastes cpu.
38from Configurables
import (
40 AvalancheSchedulerSvc,
41 ContextEventCounterData,
42 ContextEventCounterPtr,
73 SchedulerName=
"AvalancheSchedulerSvc", OutputLevel=WARNING
84 ThreadPoolSize=threads, NumOffloadThreads=gpuThreads, OutputLevel=WARNING
100a1.outKeys = [
"/Event/a1"]
103a2.inpKeys = [
"/Event/a1"]
104a2.outKeys = [
"/Event/a2"]
107a3.inpKeys = [
"/Event/a1"]
108a3.outKeys = [
"/Event/a3"]
111ga1.inpKeys = [
"/Event/a1"]
112ga1.outKeys = [
"/Event/ga1"]
115ga2.inpKeys = [
"/Event/ga1"]
116ga2.outKeys = [
"/Event/ga2"]
119a4.inpKeys = [
"/Event/a2",
"/Event/a3",
"/Event/ga2"]
121a4.outKeys = [
"/Event/a4"]
123for algo
in [a1, a2, a3, a4, ga1, ga2]:
124 algo.Cardinality = cardinality
125 algo.OutputLevel = INFO
126 algo.varRuntime = 0.001
127 algo.avgRuntime = 0.001
129for algo
in [ga1, ga2]:
130 algo.avgRuntime = 10.0
131 algo.varRuntime = 1.00
144 EventLoop=slimeventloopmgr,
145 TopAlg=[a1, a2, a3, a4, ga1, ga2, ctrp, ctrd],
147 MessageSvcType=
"InertMessageSvc",
The AlgResourcePool is a concrete implementation of the IAlgResourcePool interface.
The Application Manager class.
A class that implements a search for prime numbers.
A test asynchronous algorithm on the GPU.