Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81425 - sandbox/variadic_templates/sandbox/slim/test
From: cppljevans_at_[hidden]
Date: 2012-11-19 09:16:39


Author: cppljevans
Date: 2012-11-19 09:16:38 EST (Mon, 19 Nov 2012)
New Revision: 81425
URL: http://svn.boost.org/trac/boost/changeset/81425

Log:
Few renames and actual run data (in *.run.txt).
Shows vertical vs horizontal relative performance
depends on compiler.

Added:
   sandbox/variadic_templates/sandbox/slim/test/tuple.benchmark.tree_builder.guage_time._.run.txt (contents, props changed)
   sandbox/variadic_templates/sandbox/slim/test/tuple_benchmark_filenames.py
      - copied, changed from r81404, /sandbox/variadic_templates/sandbox/slim/test/benchmark_filenames.py
   sandbox/variadic_templates/sandbox/slim/test/tuple_benchmark_pickle.py
      - copied, changed from r81377, /sandbox/variadic_templates/sandbox/slim/test/tuple_benchmark_parserange.py
Removed:
   sandbox/variadic_templates/sandbox/slim/test/benchmark_filenames.py
   sandbox/variadic_templates/sandbox/slim/test/tuple_benchmark_parserange.py
Text files modified:
   sandbox/variadic_templates/sandbox/slim/test/Makefile | 67 +++++++++++++++++++++++----------
   sandbox/variadic_templates/sandbox/slim/test/print_domain_range.py | 8 +--
   sandbox/variadic_templates/sandbox/slim/test/tuple_benchmark_filenames.py | 30 ++++++++++++---
   sandbox/variadic_templates/sandbox/slim/test/tuple_benchmark_filt.py | 4 +
   sandbox/variadic_templates/sandbox/slim/test/tuple_benchmark_pickle.py | 19 ++++++++-
   sandbox/variadic_templates/sandbox/slim/test/tuple_benchmark_run.py | 79 +++++++++++++++++++++------------------
   6 files changed, 135 insertions(+), 72 deletions(-)

Modified: sandbox/variadic_templates/sandbox/slim/test/Makefile
==============================================================================
--- sandbox/variadic_templates/sandbox/slim/test/Makefile (original)
+++ sandbox/variadic_templates/sandbox/slim/test/Makefile 2012-11-19 09:16:38 EST (Mon, 19 Nov 2012)
@@ -1,33 +1,58 @@
 BENCHMARK.suffix=mini
 BENCHMARK.suffix=tree_builder
-TIMEFMT=%Y-%m-%d_%T_%N
-#TIMESTAMP=_
-TIMESTAMP?=$(shell date +$(TIMEFMT))
-GUAGE=guage_time
+GUAGE=guage_time #how to measure the performance (python class in compiler_guage.py)
+
+TIMEFMT:=%Y%m%d_%H%M%S_%N
+TIMEVAL:=$(shell date +$(TIMEFMT))
+#RUN_ID=20121119_073644_814249638
+RUN_ID?=_
+RUN_ID?=$(TIMEVAL)
+
 PYTHON=python
-#The following macros are only used in comments.
-SRC_BASENAME=$(shell $(PYTHON) benchmark_filenames.py $(BENCHMARK.suffix))
-OUT_BASENAME=$(shell $(PYTHON) benchmark_filenames.py $(BENCHMARK.suffix)\
- $(GUAGE)\
- $(TIMESTAMP)\
- )
 
-.PHONY: brun
-brun:#produces $(OUT_BASENAME).txt from $(SRC_BASENAME).cpp
- $(PYTHON) tuple_benchmark_run.py \
- $(GUAGE) $(BENCHMARK.suffix) $(TIMESTAMP)
+#Filename macros:
+SRC_BASENAME=$(shell $(PYTHON) tuple_benchmark_filenames.py 'src_basename' $(BENCHMARK.suffix))
+SRC_EXT=$(shell $(PYTHON) tuple_benchmark_filenames.py 'src_ext')
+OUT_SUFFIX=$(shell $(PYTHON) tuple_benchmark_filenames.py 'out_suffix' $(GUAGE) $(RUN_ID))
+RUN_EXT=$(shell $(PYTHON) tuple_benchmark_filenames.py 'run_ext')
+PKL_EXT=$(shell $(PYTHON) tuple_benchmark_filenames.py 'pkl_ext')
+FILT_EXT=$(shell $(PYTHON) tuple_benchmark_filenames.py 'filt_ext')
+
+RUN_PY=tuple_benchmark_run.py
+DOM_PY=tuple_benchmark_domain.py
+FILT_PY=tuple_benchmark_filt.py
+
+#The stem (%) in the following pattern rules should be $(SRC_BASENAME)
+
+%.$(OUT_SUFFIX).$(RUN_EXT): %.$(SRC_EXT) $(DOM_PY) $(RUN_PY)
+ #runs compiler on $<, recording preformance in $@
+ $(PYTHON) tuple_benchmark_run.py $(BENCHMARK.suffix) $(GUAGE) $(RUN_ID)
 
 .PHONY: domain
-domain:#prints the domains(inputs) used in brun target.
+domain: #prints the domains(inputs) used in $(RUN_FILENAME) target.
         $(PYTHON) tuple_benchmark_domain.py
 
-parse:#produces domain_range.pkl from $(OUT_BASENAME).txt
- $(PYTHON) tuple_benchmark_parserange.py $(OUT_BASENAME).txt
+%.$(OUT_SUFFIX).$(PKL_EXT): %.$(OUT_SUFFIX).$(RUN_EXT)
+ #produces parsed and pickled version of $< in $@
+ $(PYTHON) tuple_benchmark_pickle.py $<
+
+%.$(OUT_SUFFIX).$(FILT_EXT): %.$(OUT_SUFFIX).$(PKL_EXT) $(FILT_PY)
+ #filters $< to produce $@
+ $(PYTHON) tuple_benchmark_filt.py $< |tee $@
+
+#The following targets are just shorthand for other targets.
+.PHONY: brun
+brun: $(SRC_BASENAME).$(OUT_SUFFIX).$(RUN_EXT)
+
+.PHONY: pkl
+pkl: $(SRC_BASENAME).$(OUT_SUFFIX).$(PKL_EXT)
 
 .PHONY: filt
-filt: domain_range.pkl#produces filtered output from domain_range.pkl
- $(PYTHON) tuple_benchmark_filt.py domain_range.pkl
+filt: $(SRC_BASENAME).$(OUT_SUFFIX).$(FILT_EXT)
 
 .PHONY: show
-show:#shows selected macro values.
- echo $(OUT_BASENAME)
+show: #shows selected macro values.
+ @echo "SRC_BASENAME:"$(SRC_BASENAME)
+ @echo "OUT_SUFFIX:"$(OUT_SUFFIX)
+ @echo "RUN_FILENAME:"$(SRC_BASENAME).$(OUT_SUFFIX).$(RUN_EXT)
+

Deleted: sandbox/variadic_templates/sandbox/slim/test/benchmark_filenames.py
==============================================================================
--- sandbox/variadic_templates/sandbox/slim/test/benchmark_filenames.py 2012-11-19 09:16:38 EST (Mon, 19 Nov 2012)
+++ (empty file)
@@ -1,21 +0,0 @@
-"""
-Print to stdout a prefix of the name of the c++ source code
-benchmark.
-"""
-from __future__ import print_function
-from sys import argv
-
-def src_prefix():
- return "tuple.benchmark"
-
-def src_basename(src_suffix):
- return src_prefix()+"."+src_suffix
-
-def out_basename(src_suffix,guage,run):
- return src_basename(src_suffix)+"."+guage+"@"+run
-
-if __name__ == '__main__':
- out_name=src_basename(argv[1])
- if len(argv)>2:
- out_name=out_basename(argv[1],argv[2],argv[3])
- print(out_name)

Modified: sandbox/variadic_templates/sandbox/slim/test/print_domain_range.py
==============================================================================
--- sandbox/variadic_templates/sandbox/slim/test/print_domain_range.py (original)
+++ sandbox/variadic_templates/sandbox/slim/test/print_domain_range.py 2012-11-19 09:16:38 EST (Mon, 19 Nov 2012)
@@ -5,15 +5,13 @@
 
 def print_domain_range(domain_range):
   for domain_vals,range_vals in domain_range:
- print(":domain_values_lst=",domain_vals)
+ print(":domain=",domain_vals)
     #The reason for not using print("...",range_vals) instead
     #of the following is that the float values printed have
     #many decimal places. For some strange reason, printing
     #each with separate print function call avoids that.
- print(":range_values_lst= [",end="")
- i=0
- for val in range_vals:
+ print(":range=[",end="")
+ for i,val in enumerate(range_vals):
       if i > 0: print(", ",end="")
- i+=1
       print(val,end="")
     print("]")

Added: sandbox/variadic_templates/sandbox/slim/test/tuple.benchmark.tree_builder.guage_time._.run.txt
==============================================================================
--- (empty file)
+++ sandbox/variadic_templates/sandbox/slim/test/tuple.benchmark.tree_builder.guage_time._.run.txt 2012-11-19 09:16:38 EST (Mon, 19 Nov 2012)
@@ -0,0 +1,116 @@
+compilers[
+compiler_name: gcc4_8
+version[
+Using built-in specs.
+COLLECT_GCC=/home/evansl/download/gcc/4.8-20121028/install/bin/g++
+COLLECT_LTO_WRAPPER=/home/evansl/download/gcc/4.8-20121028/install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto-wrapper
+Target: x86_64-unknown-linux-gnu
+Configured with: /home/evansl/download/gcc/4.8-20121028/build/../src/configure --prefix=/home/evansl/download/gcc/4.8-20121028/build/../install --enable-languages=c++ --enable-checking=release
+Thread model: posix
+gcc version 4.8.0 20121028 (experimental) (GCC)
+]version
+compiler_name: clangxx
+version[
+clang version 3.2 (trunk 165317)
+Target: x86_64-unknown-linux-gnu
+Thread model: posix
+compiler_exe: /home/evansl/download/llvm/svn/build/Release/bin/clang
+]version
+]compilers
+domain_names['compiler', 'TUPLE_IMPL', 'TUPLE_SIZE', 'TUPLE_UNROLL_MAX', 'TREE_DEPTH']domain_names
+domain_values['gcc4_8', 'bcon12_horizontal', 10, -1, 2]domain_values
+range_out[
+user:0.77 system:0.07 elapsed:0.97
+]range_out
+domain_values['gcc4_8', 'bcon12_horizontal', 10, -1, 3]domain_values
+range_out[
+user:0.79 system:0.18 elapsed:0.95
+]range_out
+domain_values['gcc4_8', 'bcon12_horizontal', 10, -1, 4]domain_values
+range_out[
+user:0.97 system:0.13 elapsed:1.08
+]range_out
+domain_values['gcc4_8', 'bcon12_horizontal', 15, -1, 2]domain_values
+range_out[
+user:0.82 system:0.09 elapsed:0.89
+]range_out
+domain_values['gcc4_8', 'bcon12_horizontal', 15, -1, 3]domain_values
+range_out[
+user:1.10 system:0.09 elapsed:1.17
+]range_out
+domain_values['gcc4_8', 'bcon12_horizontal', 15, -1, 4]domain_values
+range_out[
+user:1.31 system:0.15 elapsed:1.44
+]range_out
+domain_values['gcc4_8', 'bcon12_vertical', 10, 10, 2]domain_values
+range_out[
+user:0.62 system:0.09 elapsed:0.69
+]range_out
+domain_values['gcc4_8', 'bcon12_vertical', 10, 10, 3]domain_values
+range_out[
+user:0.65 system:0.13 elapsed:0.76
+]range_out
+domain_values['gcc4_8', 'bcon12_vertical', 10, 10, 4]domain_values
+range_out[
+user:0.72 system:0.14 elapsed:0.83
+]range_out
+domain_values['gcc4_8', 'bcon12_vertical', 15, 10, 2]domain_values
+range_out[
+user:0.78 system:0.05 elapsed:0.81
+]range_out
+domain_values['gcc4_8', 'bcon12_vertical', 15, 10, 3]domain_values
+range_out[
+user:0.83 system:0.14 elapsed:0.95
+]range_out
+domain_values['gcc4_8', 'bcon12_vertical', 15, 10, 4]domain_values
+range_out[
+user:0.94 system:0.15 elapsed:1.07
+]range_out
+domain_values['clangxx', 'bcon12_horizontal', 10, -1, 2]domain_values
+range_out[
+user:0.51 system:0.07 elapsed:0.57
+]range_out
+domain_values['clangxx', 'bcon12_horizontal', 10, -1, 3]domain_values
+range_out[
+user:0.59 system:0.06 elapsed:0.64
+]range_out
+domain_values['clangxx', 'bcon12_horizontal', 10, -1, 4]domain_values
+range_out[
+user:0.78 system:0.09 elapsed:0.86
+]range_out
+domain_values['clangxx', 'bcon12_horizontal', 15, -1, 2]domain_values
+range_out[
+user:0.57 system:0.07 elapsed:0.63
+]range_out
+domain_values['clangxx', 'bcon12_horizontal', 15, -1, 3]domain_values
+range_out[
+user:0.77 system:0.03 elapsed:0.79
+]range_out
+domain_values['clangxx', 'bcon12_horizontal', 15, -1, 4]domain_values
+range_out[
+user:1.55 system:0.08 elapsed:1.61
+]range_out
+domain_values['clangxx', 'bcon12_vertical', 10, 10, 2]domain_values
+range_out[
+user:0.53 system:0.04 elapsed:0.56
+]range_out
+domain_values['clangxx', 'bcon12_vertical', 10, 10, 3]domain_values
+range_out[
+user:0.52 system:0.08 elapsed:0.59
+]range_out
+domain_values['clangxx', 'bcon12_vertical', 10, 10, 4]domain_values
+range_out[
+user:0.59 system:0.05 elapsed:0.63
+]range_out
+domain_values['clangxx', 'bcon12_vertical', 15, 10, 2]domain_values
+range_out[
+user:1.16 system:0.03 elapsed:1.18
+]range_out
+domain_values['clangxx', 'bcon12_vertical', 15, 10, 3]domain_values
+range_out[
+user:10.55 system:0.17 elapsed:10.72
+]range_out
+domain_values['clangxx', 'bcon12_vertical', 15, 10, 4]domain_values
+range_out[
+user:158.27 system:2.15 elapsed:160.45
+]range_out

Copied: sandbox/variadic_templates/sandbox/slim/test/tuple_benchmark_filenames.py (from r81404, /sandbox/variadic_templates/sandbox/slim/test/benchmark_filenames.py)
==============================================================================
--- /sandbox/variadic_templates/sandbox/slim/test/benchmark_filenames.py (original)
+++ sandbox/variadic_templates/sandbox/slim/test/tuple_benchmark_filenames.py 2012-11-19 09:16:38 EST (Mon, 19 Nov 2012)
@@ -11,11 +11,29 @@
 def src_basename(src_suffix):
     return src_prefix()+"."+src_suffix
 
-def out_basename(src_suffix,guage,run):
- return src_basename(src_suffix)+"."+guage+"@"+run
+def src_ext():
+ return "cpp"
+
+def src_filename(src_suffix):
+ return src_basename(src_suffix)+"."+src_ext()
+
+def out_suffix(guage,run_id):
+ return guage+"."+run_id
+
+def run_basename(src_suffix,guage,run_id):
+ return src_basename(src_suffix)+"."+out_suffix(guage,run_id)
+
+def run_ext():
+ return "run.txt"
+
+def pkl_ext():
+ return "pkl.txt"
+
+def filt_ext():
+ return "filt.txt"
+
+def out_filename(out_ext,src_suffix,guage,run_id):
+ return run_basename(src_suffix,guage,run_id)+"."+eval(out_ext+"_ext()")
 
 if __name__ == '__main__':
- out_name=src_basename(argv[1])
- if len(argv)>2:
- out_name=out_basename(argv[1],argv[2],argv[3])
- print(out_name)
+ print(apply(eval(argv[1]),argv[2:]),end="")

Modified: sandbox/variadic_templates/sandbox/slim/test/tuple_benchmark_filt.py
==============================================================================
--- sandbox/variadic_templates/sandbox/slim/test/tuple_benchmark_filt.py (original)
+++ sandbox/variadic_templates/sandbox/slim/test/tuple_benchmark_filt.py 2012-11-19 09:16:38 EST (Mon, 19 Nov 2012)
@@ -25,7 +25,9 @@
   #print("domain_indices=",d_ndx)
   filt_dr=filter\
     ( lambda (d_lst,r_lst)
- : d_lst[d_ndx.compiler] == 'gcc4_8'
+ : ( d_lst[d_ndx.compiler] == 'gcc4_8'
+ or d_lst[d_ndx.compiler] == 'clangxx'
+ )
       and d_lst[d_ndx.TUPLE_SIZE] == 15
     , domain_range_values
     )

Deleted: sandbox/variadic_templates/sandbox/slim/test/tuple_benchmark_parserange.py
==============================================================================
--- sandbox/variadic_templates/sandbox/slim/test/tuple_benchmark_parserange.py 2012-11-19 09:16:38 EST (Mon, 19 Nov 2012)
+++ (empty file)
@@ -1,125 +0,0 @@
-#!/usr/bin/env python
-##Purpose:
-## Parse the range output in the file produced by
-## tuple_benchmark_run.py
-##===============================================
-from __future__ import print_function
-import sys, re, pickle
-from tuple_benchmark_tags import TAG_TUPLE
-from print_domain_range import print_domain_range
-
-debug_print=0
-
-import abc
-
-class parse_range_abstract:
- """
- Abstract class for parsing output from compiler performance measurement.
- """
- __metaclass__=abc.ABCMeta
-
- @abc.abstractmethod
- def parse(range_str):
- """
- range_str is a string output from compiler performance measurement.
- This method turns that into a list or range values
- which are then returned.
- """
- pass
-
-class parse_range_time:
- """
- Concrete for parsing output from compiler performance measurement
- made with system time command.
- """
-
- def __init__(self):
- self.range_names=['user','system','elapsed']
- range_values_pat\
- ="^"\
- +self.range_names[0]\
- +":(.*) "\
- +self.range_names[1]\
- +":(.*) "\
- +self.range_names[2]\
- +":(.*)$"
- self.range_values_re=re.compile(range_values_pat)
-
- def names(self):
- return self.range_names
-
- def parse(self,range_values_str):
- found=self.range_values_re.search(range_values_str)
- range_values_lst=[]
- n=len(self.range_names)
- for i in range(1,1+n):
- range_val=float(found.group(i))
- range_values_lst.append(range_val)
- return range_values_lst
-
-def main(argv):
- result = None
- if len(argv)>1:
- run_file_inp=open(argv[1],mode='r')
- else:
- print("***expected input filename as argv[1]")
- return 1
- line_count=0
- end_compilers=re.compile("^]"+TAG_TUPLE.compilers+"$")
- for line_str in run_file_inp:
- line_count+=1
- found=end_compilers.search(line_str)
- if debug_print:
- print(":line=",line_str,end="")
- print(":found=",found)
- if found:
- break
- line_str=run_file_inp.next()
- line_count+=1
- domain_names_re=re.compile("^"+TAG_TUPLE.domain_names+"(\[.*\])"+TAG_TUPLE.domain_names+"$")
- found=domain_names_re.search(line_str)
- domain_names_lst=eval(found.group(1))
- range_parser=parse_range_time()
- print(":domain_names_lst=",domain_names_lst)
- range_names_lst=range_parser.names()
- print(":range_names_lst=",range_names_lst)
- end_range=re.compile(".*]"+TAG_TUPLE.range_out+"$")
- domain_values_pat="^"+TAG_TUPLE.domain_values+"(\[.*\])"+TAG_TUPLE.domain_values
- domain_values_re=re.compile(domain_values_pat)
- domain_range_values=[]#list_of(tuple_of(list_of(domain_values),list_of(range_values)))
- for line_str in run_file_inp:#{
- #Body of this loop appends next tuple of(list_of(domain_values),list_of(range_values))
- line_count+=1
- if debug_print:
- print(":line[",line_count,"]=",line_str,end="")
- found=domain_values_re.search(line_str)
- if not found:
- print("*** on line",line_count,"expected '"+TAG_TUPLE.domain_values+"' but found:"+line_str)
- return 1
- domain_values_lst=eval(found.group(1))#list_of(domain_values)
- line_str=run_file_inp.next()#should be 'range_out['
- line_count+=1
- range_values_str=""#will be everthing between the TAG_TUPLE.range_out begin/end tags.
- for line_str in run_file_inp:#{
- line_count+=1
- if debug_print:
- print(":line("+TAG_TUPLE.range_out+")=",line_str,end="")
- found=end_range.search(line_str)
- if found:
- break
- range_values_str+=line_str
- #}for line_str in run_file_inp:
- range_values_lst=range_parser.parse(range_values_str)
- domain_range_values.append((domain_values_lst,range_values_lst))
- #^appends tuple_of(list_of(domain_values),list_of(range_values))
- #}for line_str in run_fle_inp:
- print_domain_range(domain_range_values)
- domain_range_out=open('domain_range.pkl','wb')
- pickle.dump((domain_names_lst,range_names_lst,domain_range_values),domain_range_out)
- domain_range_out.close()
- return result
-
-if __name__ == '__main__':
- ret = main(sys.argv)
- if ret is not None:
- sys.exit(ret)

Copied: sandbox/variadic_templates/sandbox/slim/test/tuple_benchmark_pickle.py (from r81377, /sandbox/variadic_templates/sandbox/slim/test/tuple_benchmark_parserange.py)
==============================================================================
--- /sandbox/variadic_templates/sandbox/slim/test/tuple_benchmark_parserange.py (original)
+++ sandbox/variadic_templates/sandbox/slim/test/tuple_benchmark_pickle.py 2012-11-19 09:16:38 EST (Mon, 19 Nov 2012)
@@ -7,6 +7,7 @@
 import sys, re, pickle
 from tuple_benchmark_tags import TAG_TUPLE
 from print_domain_range import print_domain_range
+import tuple_benchmark_filenames
 
 debug_print=0
 
@@ -70,7 +71,7 @@
     line_count+=1
     found=end_compilers.search(line_str)
     if debug_print:
- print(":line=",line_str,end="")
+ print(":line[",line_count,"]=",line_str,sep="",end="")
       print(":found=",found)
     if found:
       break
@@ -78,6 +79,12 @@
   line_count+=1
   domain_names_re=re.compile("^"+TAG_TUPLE.domain_names+"(\[.*\])"+TAG_TUPLE.domain_names+"$")
   found=domain_names_re.search(line_str)
+ if debug_print:
+ print(":line[",line_count,"]=",line_str,sep="",end="")
+ print(":found=",found)
+ if not found:
+ print("*** on line",line_count,"expected '"+TAG_TUPLE.domain_names+"' but found:"+line_str)
+ return 1
   domain_names_lst=eval(found.group(1))
   range_parser=parse_range_time()
   print(":domain_names_lst=",domain_names_lst)
@@ -91,7 +98,7 @@
     #Body of this loop appends next tuple of(list_of(domain_values),list_of(range_values))
     line_count+=1
     if debug_print:
- print(":line[",line_count,"]=",line_str,end="")
+ print(":line[",line_count,"]=",line_str,sep="",end="")
     found=domain_values_re.search(line_str)
     if not found:
       print("*** on line",line_count,"expected '"+TAG_TUPLE.domain_values+"' but found:"+line_str)
@@ -114,7 +121,13 @@
     #^appends tuple_of(list_of(domain_values),list_of(range_values))
   #}for line_str in run_fle_inp:
   print_domain_range(domain_range_values)
- domain_range_out=open('domain_range.pkl','wb')
+ run_file_pat="^(.*)\."+tuple_benchmark_filenames.run_ext()+"$"
+ find_basename=re.compile(run_file_pat)
+ run_file_found=find_basename.search(argv[1])
+ basename=run_file_found.group(1)
+ #print(":basename=",basename)
+ pkl_filename=basename+"."+tuple_benchmark_filenames.pkl_ext()
+ domain_range_out=open(pkl_filename,'wb')
   pickle.dump((domain_names_lst,range_names_lst,domain_range_values),domain_range_out)
   domain_range_out.close()
   return result

Modified: sandbox/variadic_templates/sandbox/slim/test/tuple_benchmark_run.py
==============================================================================
--- sandbox/variadic_templates/sandbox/slim/test/tuple_benchmark_run.py (original)
+++ sandbox/variadic_templates/sandbox/slim/test/tuple_benchmark_run.py 2012-11-19 09:16:38 EST (Mon, 19 Nov 2012)
@@ -11,7 +11,7 @@
 
 from tuple_benchmark_domain import *
 import compiler_guage
-import benchmark_filenames
+import tuple_benchmark_filenames
 import boost_root
 
 def main(argv):
@@ -27,20 +27,22 @@
     measurements of the compilation of benchmark main program.
   """
   result = None
- guage_name="guage_time"
+ #set defaults for argv[1..3]
   benchmark_suffix="mini"
+ guage_name="guage_time"
   benchmark_run="_"
   #print("argv=",argv)
- if len(argv)>1:
- guage_name=argv[1]
- if len(argv)>2:
- benchmark_suffix=argv[2]
- if len(argv)>3:
- benchmark_run=argv[3]
- benchmark_basename_ext\
- = benchmark_filenames.src_basename(benchmark_suffix)\
- + ".cpp"
- #print("benchmark_basename_ext=",benchmark_basename_ext)
+ iarg=1
+ if len(argv)>=iarg:
+ benchmark_suffix=argv[iarg]
+ iarg+=1
+ if len(argv)>=iarg:
+ guage_name=argv[iarg]
+ iarg+=1
+ if len(argv)>=iarg:
+ benchmark_run=argv[iarg]
+ src_filename=tuple_benchmark_filenames.src_filename(benchmark_suffix)
+ #print("src_filename=",src_filename)
   boost_root_path=boost_root.path()
   impl_map_inc={}#implementation key -> -I include flags to compiler
   if False:
@@ -68,8 +70,8 @@
     impl_map_inc["std"]=\
         ""\
       #
- tuple_min_size=5
- tuple_max_size=5
+ tuple_min_size=10
+ tuple_max_size=15
   tuple_del_size=5
   name_domain=[
       [ 'compiler', compilers(COMPILER_MAP.keys())]
@@ -84,41 +86,46 @@
   if benchmark_suffix == "mini" :
     name_domain.append( [ 'LAST_LESS', last(4,tuple_del_size)])
   else:
- name_domain.append( [ 'TREE_DEPTH', tree_depth(2,2,1)])
+ name_domain.append( [ 'TREE_DEPTH', tree_depth(2,4,1)])
   domains=product_dep(
     map(lambda t: t[1], name_domain)
     )
   guage_fun=guage_map[guage_name]
- measure_out=\
+ run_fileobj=\
     open\
- ( benchmark_filenames.out_basename\
- ( benchmark_suffix
+ ( tuple_benchmark_filenames.out_filename\
+ ( 'run'
+ , benchmark_suffix
       , guage_name
       , benchmark_run
- ) + ".txt"
+ )
     , mode='w'
     )
- print(TAG_TUPLE.compilers+"[",file=measure_out)
+ print(TAG_TUPLE.compilers+"[",file=run_fileobj)
   for compiler_name in COMPILER_MAP.keys():
     (compiler_exe,compiler_flags)=COMPILER_MAP[compiler_name]
- print("compiler_name:",compiler_name,file=measure_out)
- print(TAG_TUPLE.version+"[",file=measure_out)
- measure_out.flush()
+ print("compiler_name:",compiler_name,file=run_fileobj)
+ print(TAG_TUPLE.version+"[",file=run_fileobj)
+ run_fileobj.flush()
     rc=subprocess.call(
         compiler_exe+" -v"
       , shell=True
- , stdout=measure_out
+ , stdout=run_fileobj
       , stderr=subprocess.STDOUT
       )
     if compiler_name == 'clangxx':
- print("compiler_exe:",compiler_exe,file=measure_out)
- print("]"+TAG_TUPLE.version,file=measure_out)
- print("]"+TAG_TUPLE.compilers,file=measure_out)
+ print("compiler_exe:",compiler_exe,file=run_fileobj)
+ print("]"+TAG_TUPLE.version,file=run_fileobj)
+ print("]"+TAG_TUPLE.compilers,file=run_fileobj)
   domain_names=list(map(lambda t:t[0],name_domain))
- print(TAG_TUPLE.domain_names,domain_names,sep="",end=TAG_TUPLE.domain_names+"\n",file=measure_out)
+ print(TAG_TUPLE.domain_names
+ , domain_names,sep="", end=TAG_TUPLE.domain_names+"\n"
+ , file=run_fileobj)
   macro_names=domain_names[1:]
   for element in domains():
- print(TAG_TUPLE.domain_values,element,sep="",end=TAG_TUPLE.domain_values+"\n",file=measure_out)
+ print(TAG_TUPLE.domain_values
+ , element, sep="", end=TAG_TUPLE.domain_values+"\n"
+ , file=run_fileobj)
       compiler_name, macro_vals=element[0], element[1:]
       #print(":compiler_name=",compiler_name,":macro_vals=",macro_vals)
       compiler_macros=""
@@ -132,14 +139,14 @@
         + compiler_flags+" "\
         + compiler_macros+" "\
         + impl_map_inc[macro_vals[0]]+" "\
- + benchmark_basename_ext\
+ + src_filename\
         #
- print(TAG_TUPLE.range_out+"[",file=measure_out)
- measure_out.flush()
- measure_rc=guage_fun.measure(compiler_exe, compiler_args, measure_out)
- print("]"+TAG_TUPLE.range_out,file=measure_out)
- if measure_rc != 0:
- return measure_rc
+ print(TAG_TUPLE.range_out+"[",file=run_fileobj)
+ run_fileobj.flush()
+ run_rc=guage_fun.measure(compiler_exe, compiler_args, run_fileobj)
+ print("]"+TAG_TUPLE.range_out,file=run_fileobj)
+ if run_rc != 0:
+ return run_rc
   return result
 
 if __name__ == '__main__':


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk