BrunelScenario Namespace Reference

Functions

def load_brunel_scenario (filename)
 

Variables

int NUMBEROFEVENTS = 100
 
int NUMBEROFEVENTSINFLIGHT = 10
 
int NUMBEROFALGOSINFLIGHT = 100
 
int NUMBEROFTHREADS = 10
 
 CLONEALGOS = True
 
 DUMPQUEUES = False
 
int SCALE = .1
 
int VERBOSITY = 5
 
 NumberOfEvents = NUMBEROFEVENTS
 
 NumberOfEventsInFlight = NUMBEROFEVENTSINFLIGHT
 
 NumberOfAlgosInFlight = NUMBEROFALGOSINFLIGHT
 
 NumberOfThreads = NUMBEROFTHREADS
 
 CloneAlgos = CLONEALGOS
 
 DumpQueues = DUMPQUEUES
 
 Scale = SCALE
 
 Verbosity = VERBOSITY
 
tuple ms = MessageSvc()
 
tuple whiteboard
 
tuple evtloop = HiveEventLoopMgr()
 
tuple app = ApplicationMgr()
 

Function Documentation

def BrunelScenario.load_brunel_scenario (   filename)

Definition at line 37 of file BrunelScenario.py.

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

Variable Documentation

tuple BrunelScenario.app = ApplicationMgr()

Definition at line 145 of file BrunelScenario.py.

BrunelScenario.CLONEALGOS = True

Definition at line 17 of file BrunelScenario.py.

BrunelScenario.CloneAlgos = CLONEALGOS

Definition at line 27 of file BrunelScenario.py.

BrunelScenario.DUMPQUEUES = False

Definition at line 18 of file BrunelScenario.py.

BrunelScenario.DumpQueues = DUMPQUEUES

Definition at line 28 of file BrunelScenario.py.

tuple BrunelScenario.evtloop = HiveEventLoopMgr()

Definition at line 136 of file BrunelScenario.py.

tuple BrunelScenario.ms = MessageSvc()

Definition at line 126 of file BrunelScenario.py.

int BrunelScenario.NUMBEROFALGOSINFLIGHT = 100

Definition at line 15 of file BrunelScenario.py.

BrunelScenario.NumberOfAlgosInFlight = NUMBEROFALGOSINFLIGHT

Definition at line 25 of file BrunelScenario.py.

int BrunelScenario.NUMBEROFEVENTS = 100

Definition at line 13 of file BrunelScenario.py.

BrunelScenario.NumberOfEvents = NUMBEROFEVENTS

Definition at line 23 of file BrunelScenario.py.

int BrunelScenario.NUMBEROFEVENTSINFLIGHT = 10

Definition at line 14 of file BrunelScenario.py.

BrunelScenario.NumberOfEventsInFlight = NUMBEROFEVENTSINFLIGHT

Definition at line 24 of file BrunelScenario.py.

int BrunelScenario.NUMBEROFTHREADS = 10

Definition at line 16 of file BrunelScenario.py.

BrunelScenario.NumberOfThreads = NUMBEROFTHREADS

Definition at line 26 of file BrunelScenario.py.

int BrunelScenario.SCALE = .1

Definition at line 19 of file BrunelScenario.py.

BrunelScenario.Scale = SCALE

Definition at line 29 of file BrunelScenario.py.

int BrunelScenario.VERBOSITY = 5

Definition at line 20 of file BrunelScenario.py.

BrunelScenario.Verbosity = VERBOSITY

Definition at line 30 of file BrunelScenario.py.

tuple BrunelScenario.whiteboard
Initial value:
1 = HiveWhiteBoard("EventDataSvc",
2  EventSlots = NumberOfEventsInFlight)

Definition at line 131 of file BrunelScenario.py.