CMS 3D CMS Logo

Functions | Variables
cmsPerfHarvest Namespace Reference

Functions

def harvest (perfdir)
 Harvest all data from a perfsuite directory (if cpu subdirectories exist, it will examine them) More...
 
def optionParse ()
 Parse options. More...
 
def visit (visitdir)
 Retrieve data from a perf suite output (sub) directory, only examines TimeSize at the moment. More...
 
def visit_timesize_steps (candle, profsetdir)
 Harvest information from a timesize directory, currently only retrieves TimingReport information. More...
 

Variables

 _PROG_NAME
 
 perfdir
 

Function Documentation

def cmsPerfHarvest.harvest (   perfdir)

Harvest all data from a perfsuite directory (if cpu subdirectories exist, it will examine them)

Definition at line 99 of file cmsPerfHarvest.py.

References visit().

99 def harvest(perfdir):
100  cpureg = re.compile("cpu_([0-9][0-9]*)")
101  out = {}
102  globpath = os.path.join(perfdir, "cpu_*")
103  globs = glob.glob(globpath)
104  if len(globs) > 0:
105  for globule in globs:
106  base = os.path.basename(globule)
107  found = cpureg.search(base)
108  if found:
109  cpuid = found.groups()[0]
110  if cpuid in out:
111  print "Error: we already have a cpu run with this id %s ! Skipping..." % cpuid
112  else:
113  if cpuid == None:
114  print "Error: could not resolve cpuid something is wrong"
115  cpuid = "None"
116  out[cpuid] = visit(globule)
117  else:
118  print "Error: could not determine valid cpu id from %s ! Skipping..." % base
119 
120  else:
121  out["None"] = visit(perfdir)
122 
123  return out
124 
def visit(visitdir)
Retrieve data from a perf suite output (sub) directory, only examines TimeSize at the moment...
def harvest(perfdir)
Harvest all data from a perfsuite directory (if cpu subdirectories exist, it will examine them) ...
def cmsPerfHarvest.optionParse ( )

Parse options.

Definition at line 12 of file cmsPerfHarvest.py.

13  parser = opt.OptionParser(usage="""./%s [perf dir] [options]""" % _PROG_NAME)
14 
15  (options, args) = parser.parse_args()
16 
17  if not len(args) == 1:
18  parser.error("You have not supplied a perfsuite directory.")
19  sys.exit()
20 
21  args[0] = os.path.abspath(args[0])
22 
23  ###########
24  # Check existance of the directory supplied
25  #
26  if not os.path.isdir(args[0]):
27  parser.error("You have not provided a valid perfsuite output directory")
28  sys.exit()
29 
30  perfdir = args[0]
31 
32  return (perfdir)
33 
def optionParse()
Parse options.
def cmsPerfHarvest.visit (   visitdir)

Retrieve data from a perf suite output (sub) directory, only examines TimeSize at the moment.

Definition at line 67 of file cmsPerfHarvest.py.

References harvestTrackValidationPlots.str, and visit_timesize_steps().

Referenced by harvest(), ConfigBuilder.ConfigBuilder.PrintAllModules.leave(), ConfigBuilder.ConfigBuilder.renameHLTprocessInSequence(), and Config.TestModuleCommand.testGlobalReplace().

67 def visit(visitdir):
68  out = {}
69  for candle in Candles:
70  globpath = os.path.join(visitdir,"%s_*" % (candle))
71  globs = glob.glob(globpath)
72  if len(globs) > 0:
73  profsetreg = re.compile("%s_(.*)" % candle)
74  for globule in globs:
75  base = os.path.basename(globule)
76  found = profsetreg.search(base)
77  if found:
78  profset = found.groups()[0]
79  if profset == "TimeSize": # Just do timesize for now!
80  if candle == None:
81  print "Error: could not resolve candle something is wrong"
82  candle = "None"
83  if profset == None:
84  print "Error: could not resolve profset something is wrong"
85  profset = "None"
86  if candle not in out:
87  out[candle] = {}
88  candledict = out[candle]
89  if profset in candledict:
90  print "Error: we already have a profset that matches %s" % str(profset)
91  else:
92  candledict[profset] = visit_timesize_steps(candle,globule)
93  out[candle] = candledict
94  return out
95 
def visit_timesize_steps(candle, profsetdir)
Harvest information from a timesize directory, currently only retrieves TimingReport information...
def visit(visitdir)
Retrieve data from a perf suite output (sub) directory, only examines TimeSize at the moment...
def cmsPerfHarvest.visit_timesize_steps (   candle,
  profsetdir 
)

Harvest information from a timesize directory, currently only retrieves TimingReport information.

Definition at line 37 of file cmsPerfHarvest.py.

Referenced by visit().

37 def visit_timesize_steps(candle,profsetdir):
38  out = {}
39  # Just do timing report for now
40  globpath = os.path.join(profsetdir,"%s_*_TimingReport.log" % CandFname[candle])
41  globs = glob.glob(globpath)
42  if len(globs) > 0:
43  stepreg = re.compile("%s_([^_]*)_TimingReport.log" % CandFname[candle])
44  for globule in globs:
45  base = os.path.basename(globule)
46  found = stepreg.search(base)
47  if found:
48  step = found.groups()[0]
49  try:
50  if step == None:
51  print "Error: could not resolve step something is wrong"
52  step = "None"
53  if "TimingReport" not in out:
54  out["TimingReport"] = {}
55  stepdict = out["TimingReport"]
56  stepdict[step] = cpr.getTimingLogData(globule)
57  out["TimingReport"] = stepdict
58  except (OSError, IOError) as detail:
59  print detail
60  else:
61  print "Error: Could not determine step from %s" % base
62  return out
63 
def visit_timesize_steps(candle, profsetdir)
Harvest information from a timesize directory, currently only retrieves TimingReport information...

Variable Documentation

cmsPerfHarvest._PROG_NAME
private

Definition at line 7 of file cmsPerfHarvest.py.

cmsPerfHarvest.perfdir

Definition at line 126 of file cmsPerfHarvest.py.