| The Gaudi Framework v29r0 (ff2e7097)

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

- Namespace List
- Namespace Members

Functions | Variables
BrunelScenarioForwardScheduler Namespace Reference

## Functions
def | load_brunel_scenario (filename)

## Variables
int | NUMBEROFEVENTS = 23
int | NUMBEROFEVENTSINFLIGHT = 7
int | NUMBEROFALGOSINFLIGHT = 11
int | NUMBEROFTHREADS = 2
int | CARDINALITY = 11
int | SCALE = .1
int | VERBOSITY = 5
| NumberOfEvents = NUMBEROFEVENTS
| NumberOfEventsInFlight = NUMBEROFEVENTSINFLIGHT
| NumberOfAlgosInFlight = NUMBEROFALGOSINFLIGHT
| NumberOfThreads = NUMBEROFTHREADS
| Cardinality = CARDINALITY
| Scale = SCALE
| Verbosity = VERBOSITY
| ms = MessageSvc()
| OutputLevel
| crunchers
| inputs
| whiteboard
| slimeventloopmgr = HiveSlimEventLoopMgr(OutputLevel=INFO)
| scheduler
| app = ApplicationMgr()
| TopAlg
| EvtSel
| EvtMax
| EventLoop
| ExtSvc
| MessageSvcType

## Function Documentation

def BrunelScenarioForwardScheduler.load_brunel_scenario | ( |  | filename | ) |

Definition at line 27 of file BrunelScenarioForwardScheduler.py.

27 def load_brunel_scenario(filename):
28 algs = {}
29 timing = {}
30 objs = []
31 curr = None
32 order = 0
33 nodes = ('/Event', '/Event/Rec', '/Event/DAQ')
34 for l in open(filename).readlines():
35 if l.find('StoreTracer') == 0:
36 if l.find('Executing Algorithm') != -1:
37 alg = l.split()[-1]
38 if alg not in algs.keys():
39 algs[alg] = (order, set(), set())
40 curr = alg
41 order += 1
42 elif l.find('Done with Algorithm') != -1:
43 curr = None
44 elif l.find('[EventDataSvc]') != -1 and curr:
45 obj = l.split()[-1]
46 if obj in nodes:
47 continue
48 if obj.find('/Event/') == 0:
49 obj = obj[7:]
50 obj = obj.replace('/', '_')
51 if obj not in objs:
52 objs.append(obj)
53 talg = algs[curr]
54 if l.find('RETRIEVE') != -1:
55 if obj not in talg[1]:
56 talg[1].add(obj)
57 elif l.find('REGOBJ') != -1:
58 if obj not in talg[2]:
59 talg[2].add(obj)
60 if l.find("TimingAuditor") != -1:
61 algo = l.split()[2] # .rstrip("|")
62 index = 13
63 if algo.endswith("|"):
64 index = 12
65 algo = algo.rstrip("|")
66 if algo in algs.keys():
67 timing[algo] = l.split()[index]
68 else:
69 for name in algs.keys():
70 if name.startswith(algo):
71 timing[name] = l.split()[index]
72
73 all_inputs = set()
74 all_outputs = set()
75 all_algos = []
76 all_algos_inputs = []
77
78 # Scale all algo timings if needed
79 if Scale != -1:
80 for alg in timing.keys():
81 old_timing = float(timing[alg])
82 new_timing = old_timing * Scale
83 # print "Algorithm %s: %f --> %f" %(alg, old_timing, new_timing)
84 timing[alg] = new_timing
85
86 for i, (alg, deps) in enumerate(algs.items()):
87 if alg in ["PatPVOffline", "PrsADCs"]:
88 continue
89 if deps[1] or deps[2]:
90 inputs = []
91 inputs = [item for item in deps[1] if item not in (
92 "DAQ_ODIN", "DAQ_RawEvent") and item not in deps[2]]
93 outputs = [item for item in deps[2]]
94 new_algo = CPUCruncher(alg,
95 avgRuntime=float(timing[alg]),
96 inpKeys=map(
97 lambda s: "/Event/" + s, inputs),
98 outKeys=map(
99 lambda s: "/Event/" + s, outputs),
100 # DataInputs=map( lambda s: "/Event/"+s, inputs),
101 # DataOutputs=map( lambda s: "/Event/"+s, outputs),
102 OutputLevel=6,
103 shortCalib=True
104 )
105
106 for item in deps[1]:
107 all_inputs.add(item)
108 for item in deps[2]:
109 all_outputs.add(item)
110 all_algos.append(new_algo)
111 all_algos_inputs.append(inputs)
112 # look for the objects that haven't been provided within the job. Assume this needs to come via input
113 new_algo = CPUCruncher("input",
114 avgRuntime=1,
115 inpKeys=[],
116 outKeys=map(
117 lambda s: "/Event/" + s, [item for item in all_inputs.difference(all_outputs)]),
118 OutputLevel=WARNING
119 )
120 all_algos.append(new_algo)
121 all_algos_inputs.append([])
122 for algo in all_algos:
123 algo.Cardinality = Cardinality
124 OutputLevel = WARNING
125
126 return all_algos, all_algos_inputs
127
128
129 # Set output level threshold 2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL )
GaudiPython.Persistency.add
def add(instance)
Definition: Persistency.py:39
Containers::map
struct GAUDI_API map
Parametrisation class for map-like implementation.
Definition: KeyedObjectManager.h:26
BrunelScenarioForwardScheduler.load_brunel_scenario
def load_brunel_scenario(filename)
Definition: BrunelScenarioForwardScheduler.py:27

## Variable Documentation

BrunelScenarioForwardScheduler.app = ApplicationMgr()

Definition at line 147 of file BrunelScenarioForwardScheduler.py.

int BrunelScenarioForwardScheduler.CARDINALITY = 11

Definition at line 11 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.Cardinality = CARDINALITY

Definition at line 19 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.crunchers

Definition at line 133 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.EventLoop

Definition at line 151 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.EvtMax

Definition at line 150 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.EvtSel

Definition at line 149 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.ExtSvc

Definition at line 152 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.inputs

Definition at line 133 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.MessageSvcType

Definition at line 153 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.ms = MessageSvc()

Definition at line 130 of file BrunelScenarioForwardScheduler.py.

int BrunelScenarioForwardScheduler.NUMBEROFALGOSINFLIGHT = 11

Definition at line 9 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.NumberOfAlgosInFlight = NUMBEROFALGOSINFLIGHT

Definition at line 17 of file BrunelScenarioForwardScheduler.py.

int BrunelScenarioForwardScheduler.NUMBEROFEVENTS = 23

Definition at line 7 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.NumberOfEvents = NUMBEROFEVENTS

Definition at line 15 of file BrunelScenarioForwardScheduler.py.

int BrunelScenarioForwardScheduler.NUMBEROFEVENTSINFLIGHT = 7

Definition at line 8 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.NumberOfEventsInFlight = NUMBEROFEVENTSINFLIGHT

Definition at line 16 of file BrunelScenarioForwardScheduler.py.

int BrunelScenarioForwardScheduler.NUMBEROFTHREADS = 2

Definition at line 10 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.NumberOfThreads = NUMBEROFTHREADS

Definition at line 18 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.OutputLevel

Definition at line 131 of file BrunelScenarioForwardScheduler.py.

int BrunelScenarioForwardScheduler.SCALE = .1

Definition at line 12 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.Scale = SCALE

Definition at line 20 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.scheduler

Initial value:
1 = ForwardSchedulerSvc(MaxEventsInFlight=NumberOfEventsInFlight,
2 MaxAlgosInFlight=NumberOfAlgosInFlight,
3 ThreadPoolSize=NumberOfThreads,
4 OutputLevel=INFO
5 )

Definition at line 140 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.slimeventloopmgr = HiveSlimEventLoopMgr(OutputLevel=INFO)

Definition at line 138 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.TopAlg

Definition at line 148 of file BrunelScenarioForwardScheduler.py.

int BrunelScenarioForwardScheduler.VERBOSITY = 5

Definition at line 13 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.Verbosity = VERBOSITY

Definition at line 21 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.whiteboard

Initial value:
1 = HiveWhiteBoard("EventDataSvc",
2 EventSlots=NumberOfEventsInFlight)

Definition at line 135 of file BrunelScenarioForwardScheduler.py.