The Gaudi Framework  v30r3 (a5ef0a68)
jsonFromLHCbLog Namespace Reference

Functions

def load_brunel_scenario (filename)
 

Variables

dictionary json = {}
 

Function Documentation

def jsonFromLHCbLog.load_brunel_scenario (   filename)

Definition at line 4 of file jsonFromLHCbLog.py.

4 def load_brunel_scenario(filename):
5  gr = graph()
6  algs = {}
7  timing = {}
8  objs = []
9  curr = None
10  order = 0
11  nodes = ('/Event', '/Event/Rec', '/Event/DAQ')
12  for l in open(filename).readlines():
13  if l.find('StoreTracer') == 0:
14  if l.find('Executing Algorithm') != -1:
15  alg = l.split()[-1]
16  if alg not in algs.keys():
17  algs[alg] = (order, set(), set())
18  curr = alg
19  order += 1
20  elif l.find('Done with Algorithm') != -1:
21  curr = None
22  elif l.find('[EventDataSvc]') != -1 and curr:
23  obj = l.split()[-1]
24  if obj in nodes:
25  continue
26  if obj.find('/Event/') == 0:
27  obj = obj[7:]
28  obj = obj.replace('/', '_')
29  if obj not in objs:
30  objs.append(obj)
31  talg = algs[curr]
32  if l.find('RETRIEVE') != -1:
33  if obj not in talg[1]:
34  talg[1].add(obj)
35  elif l.find('REGOBJ') != -1:
36  if obj not in talg[2]:
37  talg[2].add(obj)
38  if l.find("TimingAuditor") != -1:
39  algo = l.split()[2] # .rstrip("|")
40  index = 13
41  if algo.endswith("|"):
42  index = 12
43  algo = algo.rstrip("|")
44  if algo in algs.keys():
45  timing[algo] = l.split()[index]
46  else:
47  for name in algs.keys():
48  if name.startswith(algo):
49  timing[name] = l.split()[index]
50 
51  all_algos = []
52  for i, (alg, deps) in enumerate(algs.items()):
53  if alg in ["PatPVOffline", "PrsADCs"]:
54  continue
55  if deps[1] or deps[2]:
56  inputs = []
57  inputs = [item for item in deps[1] if item not in (
58  "DAQ_ODIN", "DAQ_RawEvent") and item not in deps[2]]
59  outputs = [item for item in deps[2]]
60  new_algo = {"name": alg, "inputs": inputs,
61  "outputs": outputs, "runtimes_wall": [float(timing[alg])]}
62  all_algos.append(new_algo)
63  return all_algos
64 
65 
def load_brunel_scenario(filename)

Variable Documentation

dictionary jsonFromLHCbLog.json = {}

Definition at line 68 of file jsonFromLHCbLog.py.