Functions
Projections Namespace Reference

Functions

def projectionTimes (chain, per_input_event=False, verbose=False)
 Build a projection of the time it will take to build a dataset. More...
 
def projectionSizes (chain, per_output_event=False, verbose=False)
 Build a projection of the size of each tier. More...
 
def buildPaths (chain, final_tier)
 Map out the dependency path of this chain. More...
 
def overallEfficiency (chain, verbose=False)
 The overall efficiency of this chain. More...
 
def tierEfficiency (tier)
 The efficiency of this tier. More...
 

Function Documentation

def Projections.buildPaths (   chain,
  final_tier 
)

Map out the dependency path of this chain.

Definition at line 55 of file Projections.py.

References while().

55 def buildPaths(chain, final_tier):
56  tier = chain.GetTier(final_tier)
57 
58  paths = [final_tier]
59  while(True):
60  no_dependencies = True
61  for path in paths:
62  if chain.GetTier(path).dependencies:
63  for d in chain.GetTier(path).dependencies:
64  paths.append(d)
65  no_depenencies = False
66  if no_dependencies: break
67  return paths
def buildPaths(chain, final_tier)
Map out the dependency path of this chain.
Definition: Projections.py:55
while(!feof(fp))
def Projections.overallEfficiency (   chain,
  verbose = False 
)

The overall efficiency of this chain.

Definition at line 70 of file Projections.py.

References tierEfficiency().

70 def overallEfficiency(chain,verbose=False):
71  efficiency = 1.
72  for tier in chain.tiers:
73  if tier.short_name in overlay_tiers.keys():
74  if verbose: print "proj : tier %s is an overlay tier"%tier.short_name
75  continue
76  efficiency = efficiency*tierEfficiency(tier)
77  return efficiency
def tierEfficiency(tier)
The efficiency of this tier.
Definition: Projections.py:80
def overallEfficiency(chain, verbose=False)
The overall efficiency of this chain.
Definition: Projections.py:70
def Projections.projectionSizes (   chain,
  per_output_event = False,
  verbose = False 
)

Build a projection of the size of each tier.

Definition at line 32 of file Projections.py.

References check_time_usage.float.

Referenced by ViewGoogleCharts.directoryProjectionBarChart().

32 def projectionSizes(chain, per_output_event=False, verbose=False):
33  if verbose: print "proj : --- Projection sizes"
34  tiers = chain.tiers
35  sizes = []
36  for tier in tiers:
37  if (not tier.metric.run) or (tier.metric.return_code != 0) or (tier.metric.input_events == 0):
38  sizes.append(0)
39  continue
40  m = tier.metric
41  size = 0.
42  for o in m.output_size: size +=o
43  if per_output_event:
44  n = 0.
45  for o in m.output_events:
46  if o > n: n =o
47  if tier.short_name == "caf":
48  n = m.input_events
49  if n != 0:
50  size = float(size) / float(n)
51  sizes.append(size)
52  return sizes
def projectionSizes(chain, per_output_event=False, verbose=False)
Build a projection of the size of each tier.
Definition: Projections.py:32
def Projections.projectionTimes (   chain,
  per_input_event = False,
  verbose = False 
)

Build a projection of the time it will take to build a dataset.

Definition at line 3 of file Projections.py.

References check_time_usage.float, and min().

Referenced by ViewGoogleCharts.directoryProjectionBarChart().

3 def projectionTimes(chain, per_input_event=False, verbose=False):
4  if verbose: print "proj : --- Projection times"
5  tiers = chain.tiers
6  times = []
7  for tier in tiers:
8  if not tier.metric.run or (tier.metric.return_code != 0) or (tier.metric.input_events == 0):
9  times.append(0)
10  continue
11  m = tier.metric
12  time = m.user_cpu + m.system_cpu
13  if per_input_event:
14  n = 0
15  if (m.used_events == None) and (m.input_events == None):
16  if m.output_events != None:
17  n = m.output_events
18  else:
19  assert False, "Per event time requested but number of input events isn't know in tier: %s"%tier.short_name
20  elif m.used_events and m.input_events:
21  n = min(m.used_events,m.input_events)
22  elif m.used_events:
23  n = m.used_events
24  elif m.input_events:
25  n = m.input_events
26  assert n, "No input events for tier %s"%tier.short_name
27  time = float(time) / float(n)
28  times.append(time)
29  return times
def projectionTimes(chain, per_input_event=False, verbose=False)
Build a projection of the time it will take to build a dataset.
Definition: Projections.py:3
static float min(const float a, const float b, const float c)
Definition: absgeo.cxx:45
def Projections.tierEfficiency (   tier)

The efficiency of this tier.

Definition at line 80 of file Projections.py.

References ana.assert(), exit(), check_time_usage.float, cet::sqlite.max(), and min().

Referenced by overallEfficiency().

80 def tierEfficiency(tier):
81 
82  if (tier.metric.used_events == None) and (tier.metric.input_events == None):
83  print "proj : Tier %s has no measure of the number of input events"%tier.short_name
84  exit(1)
85  elif tier.metric.used_events and tier.metric.input_events:
86  in_events = min(tier.metric.used_events,tier.metric.input_events)
87  elif tier.metric.used_events:
88  in_events = tier.metric.used_events
89  else:
90  in_events = tier.metric.input_events
91 
92  assert(in_events>0)
93 
94  if len(tier.metric.output_events) > 1:
95  print "proj : Tier %s has multiple output streams, we must pick one: %s, using the max for now"%\
96  (tier.short_name, repr(tier.output_name))
97  out_events = max(tier.metric.output_events)
98 
99  if out_events == 0: return 0.
100  else: return float(out_events) / float(in_events)
101 
def tierEfficiency(tier)
The efficiency of this tier.
Definition: Projections.py:80
static float min(const float a, const float b, const float c)
Definition: absgeo.cxx:45
exit(0)
assert(nhit_max >=nhit_nbins)
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:68