| The Gaudi Framework v27r1

- 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 | CARDINALITY = 11
int | SCALE = .1
int | VERBOSITY = 5
| NumberOfEvents = NUMBEROFEVENTS
| NumberOfEventsInFlight = NUMBEROFEVENTSINFLIGHT
| NumberOfAlgosInFlight = NUMBEROFALGOSINFLIGHT
| Cardinality = CARDINALITY
| Scale = SCALE
| Verbosity = VERBOSITY
tuple | ms = MessageSvc()
tuple | whiteboard
tuple | slimeventloopmgr = HiveSlimEventLoopMgr(OutputLevel = INFO)
tuple | scheduler
tuple | app = ApplicationMgr()

## Function Documentation

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

Definition at line 26 of file BrunelScenarioForwardScheduler.py.

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

## Variable Documentation

tuple BrunelScenarioForwardScheduler.app = ApplicationMgr()

Definition at line 132 of file BrunelScenarioForwardScheduler.py.

int BrunelScenarioForwardScheduler.CARDINALITY = 11

Definition at line 10 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.Cardinality = CARDINALITY

Definition at line 17 of file BrunelScenarioForwardScheduler.py.

tuple BrunelScenarioForwardScheduler.ms = MessageSvc()

Definition at line 116 of file BrunelScenarioForwardScheduler.py.

int BrunelScenarioForwardScheduler.NUMBEROFALGOSINFLIGHT = 11

Definition at line 9 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.NumberOfAlgosInFlight = NUMBEROFALGOSINFLIGHT

Definition at line 16 of file BrunelScenarioForwardScheduler.py.

int BrunelScenarioForwardScheduler.NUMBEROFEVENTS = 23

Definition at line 7 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.NumberOfEvents = NUMBEROFEVENTS

Definition at line 14 of file BrunelScenarioForwardScheduler.py.

int BrunelScenarioForwardScheduler.NUMBEROFEVENTSINFLIGHT = 7

Definition at line 8 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.NumberOfEventsInFlight = NUMBEROFEVENTSINFLIGHT

Definition at line 15 of file BrunelScenarioForwardScheduler.py.

int BrunelScenarioForwardScheduler.SCALE = .1

Definition at line 11 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.Scale = SCALE

Definition at line 18 of file BrunelScenarioForwardScheduler.py.

tuple BrunelScenarioForwardScheduler.scheduler

Initial value:
1 = ForwardSchedulerSvc(MaxEventsInFlight = NumberOfEventsInFlight,
2 MaxAlgosInFlight = NumberOfAlgosInFlight,
3 OutputLevel = WARNING,
4 AlgosDependencies = inputs)

Definition at line 126 of file BrunelScenarioForwardScheduler.py.

tuple BrunelScenarioForwardScheduler.slimeventloopmgr = HiveSlimEventLoopMgr(OutputLevel = INFO)

Definition at line 124 of file BrunelScenarioForwardScheduler.py.

int BrunelScenarioForwardScheduler.VERBOSITY = 5

Definition at line 12 of file BrunelScenarioForwardScheduler.py.

BrunelScenarioForwardScheduler.Verbosity = VERBOSITY

Definition at line 19 of file BrunelScenarioForwardScheduler.py.

tuple BrunelScenarioForwardScheduler.whiteboard

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

Definition at line 121 of file BrunelScenarioForwardScheduler.py.