| The Gaudi Framework v28r2p1 (f1a77ff4)

- 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 28 of file BrunelScenarioForwardScheduler.py.

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

## Variable Documentation

BrunelScenarioForwardScheduler.app = ApplicationMgr()

Definition at line 137 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 123 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.EventLoop

Definition at line 141 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.EvtMax

Definition at line 140 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.EvtSel

Definition at line 139 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.ExtSvc

Definition at line 142 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.inputs

Definition at line 123 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.MessageSvcType

Definition at line 143 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.ms = MessageSvc()

Definition at line 120 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 121 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 130 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.slimeventloopmgr = HiveSlimEventLoopMgr(OutputLevel = INFO)

Definition at line 128 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.TopAlg

Definition at line 138 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 125 of file BrunelScenarioForwardScheduler.py.