4 Reference optionfile which shows in a simple way how to take advantage of the 5 Gaudi components desicated to concurrency. 7 o HiveWhiteBoard: a convenient way to collect several TES (one per "processing 8 slot"), accessible in a thread safe way, keeps a catalogue of the products 9 written on each processing slot. The number of slots in the whiteboard 10 determines also the number of events processed simultaneously by the scheduler. 11 o AvalancheSchedulerSvc: state machine of the algorithms interfaced with the 12 TBB runtime. It is responsible for the submission of the algorithms. An 13 algorithm is marked ready for submission when its needed input is available. 14 It deals the asynchronous termination of algorithms with a "receiver" thread 15 and a thread safe queue. 16 o HiveSlimEventLoopMgr: an event factory. Pushes new events and pops finished 17 events to/from the scheduler. It does not manage algorithms/streams. 18 o AlgResourcePool: Service managing the creation of algorithms (through the 19 algorithm manager), including clones. It also manages the algorithms according 20 to the resources they need (parameter NeededResources - vector of strings - of 22 o InertMessageSvc: as the TBBMsgSvc, it manages the printing of the messages in 23 a multithreaded environment. 25 The CPUCruncher is not a component dealing with concurrency, but a useful 26 entity to test it. It's an algorithm that simply wastes cpu. 30 from Configurables
import (HiveWhiteBoard, HiveSlimEventLoopMgr,
31 AvalancheSchedulerSvc, AlgResourcePool,
33 ContextEventCounterPtr,
34 ContextEventCounterData)
58 SchedulerName=
"AvalancheSchedulerSvc", OutputLevel=DEBUG)
81 a1.outKeys = [
'/Event/a1']
84 a2.inpKeys = [
'/Event/a1']
85 a2.outKeys = [
'/Event/a2']
88 a3.inpKeys = [
'/Event/a1']
89 a3.outKeys = [
'/Event/a3']
92 a4.inpKeys = [
'/Event/a2',
'/Event/a3']
93 a4.outKeys = [
'/Event/a4']
95 for algo
in [a1, a2, a3, a4]:
96 algo.shortCalib =
True 97 algo.Cardinality = cardinality
98 algo.OutputLevel = WARNING
111 EventLoop=slimeventloopmgr,
112 TopAlg=[a1, a2, a3, a4, ctrp, ctrd],
113 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.