| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

SequentialAlgSequencerTest.py
Go to the documentation of this file.
1 from Gaudi.Configuration import *
2 from Configurables import (HiveWhiteBoard, HiveSlimEventLoopMgr,
3 AvalancheSchedulerSvc, AlgResourcePool,
4 CPUCruncher,
5 ContextEventCounterPtr,
6 ContextEventCounterData,
7 GaudiSequencer)
8
9 # metaconfig -------------------------------------------------------------------
10 # It's confortable to collect the relevant parameters at the top of the optionfile
11 evtslots = 5
12 evtMax = 20
13 cardinality = 5
14 algosInFlight = 10
15 #-------------------------------------------------------------------------------
16
17 # The configuration of the whiteboard ------------------------------------------
18 # It is useful to call it EventDataSvc to replace the usual data service with
19 # the whiteboard transparently.
20
21 whiteboard = HiveWhiteBoard("EventDataSvc",
22 EventSlots=evtslots)
23
24 #-------------------------------------------------------------------------------
25
26 # Event Loop Manager -----------------------------------------------------------
27 # It's called slim since it has less functionalities overall than the good-old
28 # event loop manager. Here we just set its outputlevel to DEBUG.
29
30 slimeventloopmgr = HiveSlimEventLoopMgr(OutputLevel=DEBUG)
31
32 #-------------------------------------------------------------------------------
33
34 # Avalanche Scheduler ----------------------------------------------------------
35 # We just decide how many algorithms in flight we want to have and how many
36 # threads in the pool. The default value is -1, which is for TBB equivalent
37 # to take over the whole machine.
38
39 scheduler = AvalancheSchedulerSvc(ThreadPoolSize=algosInFlight,
40 OutputLevel=DEBUG)
41
42 #-------------------------------------------------------------------------------
43
44 # Algo Resource Pool -----------------------------------------------------------
45 # Nothing special here, we just set the debug level.
46 AlgResourcePool(OutputLevel=DEBUG)
47
48 #-------------------------------------------------------------------------------
49
50 # Set up of the crunchers, daily business --------------------------------------
51
52 a1 = CPUCruncher("A1")
53 a1.outKeys = ['/Event/a1']
54
55 a2 = CPUCruncher("A2")
56 a2.inpKeys = ['/Event/a1']
57 a2.outKeys = ['/Event/a2']
58
59 a3 = CPUCruncher("A3")
60 a3.inpKeys = ['/Event/a1']
61 a3.outKeys = ['/Event/a3']
62
63 a4 = CPUCruncher("A4")
64 a4.inpKeys = ['/Event/a2']
65 a4.outKeys = ['/Event/a4']
66
67 for algo in [a1, a2, a3, a4]:
68 algo.shortCalib = True
69 algo.OutputLevel = DEBUG
70 algo.varRuntime = .3
71 algo.avgRuntime = .5
72
73 for algo in [a3]:
74 algo.Cardinality = cardinality
75
76 seq = GaudiSequencer("CriticalSection",
77 Members=[a1, a2, a4],
78 Sequential=True,
79 OutputLevel=VERBOSE)
80
81 # Application Manager ----------------------------------------------------------
82 # We put everything together and change the type of message service
83
84 ApplicationMgr(EvtMax=evtMax,
85 EvtSel='NONE',
86 ExtSvc=[whiteboard],
87 EventLoop=slimeventloopmgr,
88 TopAlg=[seq, a3],
89 MessageSvcType="InertMessageSvc")
CPUCruncher
A class that implements a search for prime numbers.
Definition: CPUCruncher.h:18
GaudiSequencer
Sequencer for executing several algorithms, stopping when one is faulty.
Definition: GaudiSequencer.h:26
HiveSlimEventLoopMgr
Definition: HiveSlimEventLoopMgr.h:26
Gaudi.Configuration
Definition: Configuration.py:1
AlgResourcePool
The AlgResourcePool is a concrete implementation of the IAlgResourcePool interface.
Definition: AlgResourcePool.h:29
HiveWhiteBoard
Data service base class.
Definition: HiveWhiteBoard.cpp:149
AvalancheSchedulerSvc
Introduction
Definition: AvalancheSchedulerSvc.h:102
ApplicationMgr
The Application Manager class.
Definition: ApplicationMgr.h:47