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 100 of file cmsPerfHarvest.py.

References edm.print(), and visit().

100 def harvest(perfdir):
101  cpureg = re.compile("cpu_([0-9][0-9]*)")
102  out = {}
103  globpath = os.path.join(perfdir, "cpu_*")
104  globs = glob.glob(globpath)
105  if len(globs) > 0:
106  for globule in globs:
107  base = os.path.basename(globule)
108  found = cpureg.search(base)
109  if found:
110  cpuid = found.groups()[0]
111  if cpuid in out:
112  print("Error: we already have a cpu run with this id %s ! Skipping..." % cpuid)
113  else:
114  if cpuid == None:
115  print("Error: could not resolve cpuid something is wrong")
116  cpuid = "None"
117  out[cpuid] = visit(globule)
118  else:
119  print("Error: could not determine valid cpu id from %s ! Skipping..." % base)
120 
121  else:
122  out["None"] = visit(perfdir)
123 
124  return out
125 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
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 13 of file cmsPerfHarvest.py.

14  parser = opt.OptionParser(usage="""./%s [perf dir] [options]""" % _PROG_NAME)
15 
16  (options, args) = parser.parse_args()
17 
18  if not len(args) == 1:
19  parser.error("You have not supplied a perfsuite directory.")
20  sys.exit()
21 
22  args[0] = os.path.abspath(args[0])
23 
24  ###########
25  # Check existance of the directory supplied
26  #
27  if not os.path.isdir(args[0]):
28  parser.error("You have not provided a valid perfsuite output directory")
29  sys.exit()
30 
31  perfdir = args[0]
32 
33  return (perfdir)
34 
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 68 of file cmsPerfHarvest.py.

References edm.print(), str, and visit_timesize_steps().

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

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

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

Definition at line 38 of file cmsPerfHarvest.py.

References edm.print().

Referenced by visit().

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

Variable Documentation

cmsPerfHarvest._PROG_NAME
private

Definition at line 8 of file cmsPerfHarvest.py.

cmsPerfHarvest.perfdir

Definition at line 127 of file cmsPerfHarvest.py.