CMS 3D CMS Logo

Functions | Variables
cmsIgProf_Analysis Namespace Reference

Functions

def diff_igprof_analysis (profile_name, regression_profile_name, AnalysisType)
 
def execute (command)
 
def library_igprof_analysis (profile_name, AnalysisType)
 
def simple_igprof_analysis (profile_name, AnalysisType, output_type)
 

Variables

 action
 
 AnalysisType
 
 args
 
 default
 
 dest
 
 help
 
 IgProfProfile
 
 options
 
 parser
 
 usage
 

Function Documentation

def cmsIgProf_Analysis.diff_igprof_analysis (   profile_name,
  regression_profile_name,
  AnalysisType 
)
This function takes as arguments:
-a compressed (.gz) igprof output profile
-a second compressed (.gz) igprof output profile against which a regression analysis is intended to be done
-the output directory where to store the output of the regression analysis
Based on this information it automatically selects the igprof counter (PERF_TICKS, MEM_TOTAL or MEM_LIVE) to use
with igprof-analyse and it performs the regression analysis with SQLite3 output.

Definition at line 79 of file cmsIgProf_Analysis.py.

References execute(), python.rootplot.root2matplotlib.replace(), and split.

79 def diff_igprof_analysis(profile_name,regression_profile_name,AnalysisType):
80 
81  """
82  This function takes as arguments:
83  -a compressed (.gz) igprof output profile
84  -a second compressed (.gz) igprof output profile against which a regression analysis is intended to be done
85  -the output directory where to store the output of the regression analysis
86  Based on this information it automatically selects the igprof counter (PERF_TICKS, MEM_TOTAL or MEM_LIVE) to use
87  with igprof-analyse and it performs the regression analysis with SQLite3 output.
88  """
89  #Following Giulio's filename convention:
90  outfile=profile_name.split(".")[0].replace(IgProfProfile[AnalysisType],AnalysisType)+"_diff_"+regression_profile_name.split(".")[0].split("___")[-1]+".sql3"
91  command='igprof-analyse --sqlite -d -v -g --diff-mode -b %s -r %s %s |sqlite3 %s'%(regression_profile_name, AnalysisType,profile_name,outfile)
92  exit=execute(command)
93 
94  return exit
def replace(string, replacements)
def diff_igprof_analysis(profile_name, regression_profile_name, AnalysisType)
double split
Definition: MVATrainer.cc:139
def cmsIgProf_Analysis.execute (   command)

Definition at line 17 of file cmsIgProf_Analysis.py.

Referenced by diff_igprof_analysis(), library_igprof_analysis(), edm::SerialTaskQueue::QueuedTask< T >.QueuedTask(), edm::NoProcessProductResolver.setCache(), and simple_igprof_analysis().

17 def execute(command):
18  print '[IgAnalysis] %s ...' %command
19  sys.stdout.flush()
20  exitstate=os.system(command)
21  return exitstate
22 
def cmsIgProf_Analysis.library_igprof_analysis (   profile_name,
  AnalysisType 
)
This function takes as arguments:
-a compressed (.gz) igprof output profile
-the output directory where to store the output of the igprof-analysis merging the results by library
Based on this information it automatically selects the igprof counter (PERF_TICKS, MEM_TOTAL or MEM_LIVE) to use
with igprof-analyse and it performs the igprof-analyse analysis merging the results by library and saving the results
in the usual igprof-navigator browseable SQLite3 format.

Definition at line 95 of file cmsIgProf_Analysis.py.

References execute(), and python.rootplot.root2matplotlib.replace().

95 def library_igprof_analysis(profile_name,AnalysisType):
96 
97  """
98  This function takes as arguments:
99  -a compressed (.gz) igprof output profile
100  -the output directory where to store the output of the igprof-analysis merging the results by library
101  Based on this information it automatically selects the igprof counter (PERF_TICKS, MEM_TOTAL or MEM_LIVE) to use
102  with igprof-analyse and it performs the igprof-analyse analysis merging the results by library and saving the results
103  in the usual igprof-navigator browseable SQLite3 format.
104  """
105  #Following Giulio's filename convention:
106  outfile=profile_name.split(".")[0].replace(IgProfProfile[AnalysisType],AnalysisType)+"_merged"+".sql3"
107  #Regular Expression supplied by Giulio:
108  command="igprof-analyse --sqlite -d -v -g -r %s -ml -mr 's|.*/(.*)$|\\1|' %s |sqlite3 %s"%(AnalysisType,profile_name,outfile)
109  exit=execute(command)
110 
111  return exit
112 #-------------------------------------------------------------------------------
113 
114 # A procedure used for importing the function above with the import statement
115 # or to run it if the script is called: power python..
def library_igprof_analysis(profile_name, AnalysisType)
def replace(string, replacements)
def cmsIgProf_Analysis.simple_igprof_analysis (   profile_name,
  AnalysisType,
  output_type 
)
This function takes as arguments:
-a compressed (.gz) igprof output profile
-the output directory where to store the output
-the type of output wanted
Based on this information it automatically selects the igprof counter
(PERF_TICKS, MEM_TOTAL or MEM_LIVE) to use with igprof-analyse and it
performs the analysis.
If ASCII output_type is given, it keeps only the first seven lines of
the output file (the report) allowing quick access to the totals for
the counters in order to put together summary tables.
If SQLite3 output_type is given, it simply dumps the full reports in
sqlite3 format, ready to be browsed by igprof-navigator GUI (standalone
or cgi-bin).

Definition at line 23 of file cmsIgProf_Analysis.py.

References execute(), and python.rootplot.root2matplotlib.replace().

23 def simple_igprof_analysis(profile_name,AnalysisType,output_type):
24 
25  """This function takes as arguments:
26  -a compressed (.gz) igprof output profile
27  -the output directory where to store the output
28  -the type of output wanted
29  Based on this information it automatically selects the igprof counter
30  (PERF_TICKS, MEM_TOTAL or MEM_LIVE) to use with igprof-analyse and it
31  performs the analysis.
32  If ASCII output_type is given, it keeps only the first seven lines of
33  the output file (the report) allowing quick access to the totals for
34  the counters in order to put together summary tables.
35  If SQLite3 output_type is given, it simply dumps the full reports in
36  sqlite3 format, ready to be browsed by igprof-navigator GUI (standalone
37  or cgi-bin).
38  """
39  #Use profile input file to determine the name of the output file adding the counter to it:
40  #outfile=profile_name[:-3]+"___"+AnalysisType+".res"
41  outfile=profile_name.split(".")[0].replace(IgProfProfile[AnalysisType],AnalysisType)+".res"
42  #Launch the 1 command:
43 
44  #command='igprof-analyse -d -v -g -r %s %s|tee -a \%s'%(AnalysisType,profile_name,outfile)
45  #Replacing tee: it is polluting the log files...
46 
47  #igprof-analyse command depends on the output type desired:
48  if output_type =="SQLite3":
49  #Case of dumping the igprof-analyse report in sqlite format to be igprof-navigator browseable
50  outfile= outfile[:-3]+"sql3" #NEED TO USE sql3 to be compatible with CGI-BIN igprof-navigator
51  command='igprof-analyse --sqlite -d -v -g -r %s %s |sqlite3 %s'%(AnalysisType,profile_name,outfile)
52  #Execute the igprof-analyse command
53  exit=execute(command)
54  elif output_type =="ASCII":
55  #We can keep this part of the igprof-analysis, to create the html table with the totals at each dump
56  command='igprof-analyse -d -v -g -r %s %s > %s'%(AnalysisType,profile_name,outfile)
57  #Execute the igprof-analyse command
58  exit=execute(command)
59  #Let's manipulate the ASCII output to only keep the top 7 lines:
60  # we open and read the txt ascii file
61  print "Reading the res file"
62  txt_file=open(outfile,'r')
63  txt_file_content=txt_file.readlines()#again:everything is an object
64  print "res file has %s lines!"%len(txt_file_content)
65  txt_file.close()
66  #overwrite the file to only save the first 7 lines:
67  print "Overwriting the res file, to reduce it to 7 lines"
68  out_file=open(outfile,'w')
69  line_num=0
70  for line in txt_file_content:
71  out_file.write(line)
72  line_num+=1
73  if line_num == 7:
74  break
75  out_file.close()
76 
77  return exit
78 
def replace(string, replacements)
def simple_igprof_analysis(profile_name, AnalysisType, output_type)

Variable Documentation

cmsIgProf_Analysis.action

Definition at line 142 of file cmsIgProf_Analysis.py.

cmsIgProf_Analysis.AnalysisType

Definition at line 154 of file cmsIgProf_Analysis.py.

cmsIgProf_Analysis.args

Definition at line 145 of file cmsIgProf_Analysis.py.

cmsIgProf_Analysis.default

Definition at line 125 of file cmsIgProf_Analysis.py.

cmsIgProf_Analysis.dest

Definition at line 126 of file cmsIgProf_Analysis.py.

cmsIgProf_Analysis.help

Definition at line 124 of file cmsIgProf_Analysis.py.

cmsIgProf_Analysis.IgProfProfile

Definition at line 11 of file cmsIgProf_Analysis.py.

cmsIgProf_Analysis.options

Definition at line 145 of file cmsIgProf_Analysis.py.

cmsIgProf_Analysis.parser

Definition at line 122 of file cmsIgProf_Analysis.py.

cmsIgProf_Analysis.usage

Definition at line 121 of file cmsIgProf_Analysis.py.