3 Reference optionfile which shows in a simple way how to take advantage of the 4 Gaudi components desicated to concurrency. 6 o HiveWhiteBoard: a convenient way to collect several TES (one per "processing 7 slot"), accessible in a thread safe way, keeps a catalogue of the products 8 written on each processing slot. The number of slots in the whiteboard 9 determines also the number of events processed simultaneously by the scheduler. 10 o AvalancheSchedulerSvc: state machine of the algorithms interfaced with the 11 TBB runtime. It is responsible for the submission of the algorithms. An 12 algorithm is marked ready for submission when its needed input is available. 13 It deals the asynchronous termination of algorithms with a "receiver" thread 14 and a thread safe queue. 15 o HiveSlimEventLoopMgr: an event factory. Pushes new events and pops finished 16 events to/from the scheduler. It does not manage algorithms/streams. 17 o AlgResourcePool: Service managing the creation of algorithms (through the 18 algorithm manager), including clones. It also manages the algorithms according 19 to the resources they need (parameter NeededResources - vector of strings - of 21 o InertMessageSvc: as the TBBMsgSvc, it manages the printing of the messages in 22 a multithreaded environment. 24 The CPUCruncher is not a component dealing with concurrency, but a useful 25 entity to test it. It's an algorithm that simply wastes cpu. 29 from Configurables
import (HiveWhiteBoard, HiveSlimEventLoopMgr,
30 AvalancheSchedulerSvc, AlgResourcePool, CPUCruncher,
31 ContextEventCounterPtr, ContextEventCounterData,
55 SchedulerName=
"AvalancheSchedulerSvc", OutputLevel=DEBUG)
79 a1.outKeys = [
'/Event/a1']
82 a2.inpKeys = [
'/Event/a1']
83 a2.outKeys = [
'/Event/a2']
86 a3.inpKeys = [
'/Event/a1']
87 a3.outKeys = [
'/Event/a3']
90 a4.inpKeys = [
'/Event/a2',
'/Event/a3']
91 a4.outKeys = [
'/Event/a4']
93 for algo
in [a1, a2, a3, a4]:
94 algo.Cardinality = cardinality
95 algo.OutputLevel = WARNING
109 EventLoop=slimeventloopmgr,
110 TopAlg=[a1, a2, a3, a4, ctrp, ctrd],
111 MessageSvcType=
"InertMessageSvc")
A class that implements a search for prime numbers.
The AlgResourcePool is a concrete implementation of the IAlgResourcePool interface.
The Application Manager class.