diff options
author | 2008-07-09 14:04:48 +0000 | |
---|---|---|
committer | 2008-07-09 14:04:48 +0000 | |
commit | 28539e7597c643dbc2b8d4f49dd16bd86fb7251f (patch) | |
tree | 3bfb96ae898f0afc943a388edcc83c27d28d5b3a /bench/btl/data | |
parent | 5f55ab524cf0aad34dd6884bcae09eaa6c43c247 (diff) |
imported a reworked version of BTL (Benchmark for Templated Libraries).
the modifications to initial code follow:
* changed build system from plain makefiles to cmake
* added eigen2 (4 versions: vec/novec and fixed/dynamic), GMM++, MTL4 interfaces
* added "transposed matrix * vector" product action
* updated blitz interface to use condensed products instead of hand coded loops
* removed some deprecated interfaces
* changed default storage order to column major for all libraries
* new generic bench timer strategy which is supposed to be more accurate
* various code clean-up
Diffstat (limited to 'bench/btl/data')
-rw-r--r-- | bench/btl/data/CMakeLists.txt | 18 | ||||
-rw-r--r-- | bench/btl/data/aat.hh | 108 | ||||
-rw-r--r-- | bench/btl/data/ata.hh | 108 | ||||
-rw-r--r-- | bench/btl/data/axpy.hh | 108 | ||||
-rwxr-xr-x | bench/btl/data/go_mean | 9 | ||||
-rw-r--r-- | bench/btl/data/matrix_matrix.hh | 108 | ||||
-rw-r--r-- | bench/btl/data/matrix_vector.hh | 108 | ||||
-rw-r--r-- | bench/btl/data/mean.cxx | 207 | ||||
-rw-r--r-- | bench/btl/data/mk_gnuplot_script.sh | 68 | ||||
-rw-r--r-- | bench/btl/data/mk_mean_script.sh | 39 | ||||
-rwxr-xr-x | bench/btl/data/mk_new_gnuplot.sh | 45 | ||||
-rw-r--r-- | bench/btl/data/order_lib | 8 | ||||
-rw-r--r-- | bench/btl/data/regularize.cxx | 131 | ||||
-rw-r--r-- | bench/btl/data/smooth.cxx | 198 | ||||
-rwxr-xr-x | bench/btl/data/smooth_all.sh | 68 |
15 files changed, 1331 insertions, 0 deletions
diff --git a/bench/btl/data/CMakeLists.txt b/bench/btl/data/CMakeLists.txt new file mode 100644 index 000000000..365652ca9 --- /dev/null +++ b/bench/btl/data/CMakeLists.txt @@ -0,0 +1,18 @@ + +ADD_CUSTOM_TARGET(copy_scripts) + +SET(script_files go_mean aat.hh ata.hh axpy.hh order_lib mk_mean_script.sh mk_new_gnuplot.sh mk_gnuplot_script.sh matrix_matrix.hh matrix_vector.hh) + +FOREACH(script_file ${script_files}) +ADD_CUSTOM_COMMAND( + TARGET copy_scripts + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${script_file} ${CMAKE_CURRENT_BINARY_DIR}/ + ARGS +) +ENDFOREACH(script_file) + +add_executable(smooth smooth.cxx) +add_executable(regularize regularize.cxx) +add_executable(main mean.cxx) +add_dependencies(main copy_scripts) diff --git a/bench/btl/data/aat.hh b/bench/btl/data/aat.hh new file mode 100644 index 000000000..d91f4e3bf --- /dev/null +++ b/bench/btl/data/aat.hh @@ -0,0 +1,108 @@ +#!/usr/bin/gnuplot -persist +# +# +# G N U P L O T +# Linux version 3.7 +# patchlevel 0 +# last modified Thu Jan 14 19:34:53 BST 1999 +# +# Copyright(C) 1986 - 1993, 1998, 1999 +# Thomas Williams, Colin Kelley and many others +# +# Type `help` to access the on-line reference manual +# The gnuplot FAQ is available from +# <http://www.uni-karlsruhe.de/~ig25/gnuplot-faq/> +# +# Send comments and requests for help to <info-gnuplot@dartmouth.edu> +# Send bugs, suggestions and mods to <bug-gnuplot@dartmouth.edu> +# +# set terminal postscript landscape noenhanced monochrome dashed defaultplex "Helvetica" 14 +# set output 'bench_gcc.ps' +set noclip points +set clip one +set noclip two +set bar 1.000000 +set border 31 lt -1 lw 1.000 +set xdata +set ydata +set zdata +set x2data +set y2data +set boxwidth +set dummy x,y +set format x "%g" +set format y "%g" +set format x2 "%g" +set format y2 "%g" +set format z "%g" +set angles radians +set nogrid +set key title "" +set key right top Right noreverse box linetype -2 linewidth 1.000 samplen 4 spacing 1 width 0 +set nolabel +set noarrow +set nolinestyle +set nologscale +set logscale x 10 +set offsets 0, 0, 0, 0 +set pointsize 1 +set encoding default +set nopolar +set noparametric +set view 60, 30, 1, 1 +set samples 100, 100 +set isosamples 10, 10 +set surface +set nocontour +set clabel '%8.3g' +set mapping cartesian +set nohidden3d +set cntrparam order 4 +set cntrparam linear +set cntrparam levels auto 5 +set cntrparam points 5 +set size ratio 0 1,1 +set origin 0,0 +set data style linespoints +set function style lines +set xzeroaxis lt -2 lw 1.000 +set x2zeroaxis lt -2 lw 1.000 +set yzeroaxis lt -2 lw 1.000 +set y2zeroaxis lt -2 lw 1.000 +set tics in +set ticslevel 0.5 +set ticscale 1 0.5 +set mxtics default +set mytics default +set mx2tics default +set my2tics default +set xtics border mirror norotate autofreq +set ytics border mirror norotate autofreq +set ztics border nomirror norotate autofreq +set nox2tics +set noy2tics +set title "A x At product " 0.000000,0.000000 "" +set timestamp "" bottom norotate 0.000000,0.000000 "" +set rrange [ * : * ] noreverse nowriteback # (currently [-0:10] ) +set trange [ * : * ] noreverse nowriteback # (currently [-5:5] ) +set urange [ * : * ] noreverse nowriteback # (currently [-5:5] ) +set vrange [ * : * ] noreverse nowriteback # (currently [-5:5] ) +set xlabel "matrix size" 0.000000,0.000000 "" +set x2label "" 0.000000,0.000000 "" +set timefmt "%d/%m/%y\n%H:%M" +set xrange [ 10 : 1000 ] noreverse nowriteback +set x2range [ * : * ] noreverse nowriteback # (currently [-10:10] ) +set ylabel "MFLOPS" 0.000000,0.000000 "" +set y2label "" 0.000000,0.000000 "" +set yrange [ * : * ] noreverse nowriteback # (currently [-10:10] ) +set y2range [ * : * ] noreverse nowriteback # (currently [-10:10] ) +set zlabel "" 0.000000,0.000000 "" +set zrange [ * : * ] noreverse nowriteback # (currently [-10:10] ) +set zero 1e-08 +set lmargin -1 +set bmargin -1 +set rmargin -1 +set tmargin -1 +set locale "C" +set xrange [10:1000] +##set yrange [0:400] diff --git a/bench/btl/data/ata.hh b/bench/btl/data/ata.hh new file mode 100644 index 000000000..d553f7000 --- /dev/null +++ b/bench/btl/data/ata.hh @@ -0,0 +1,108 @@ +#!/usr/bin/gnuplot -persist +# +# +# G N U P L O T +# Linux version 3.7 +# patchlevel 0 +# last modified Thu Jan 14 19:34:53 BST 1999 +# +# Copyright(C) 1986 - 1993, 1998, 1999 +# Thomas Williams, Colin Kelley and many others +# +# Type `help` to access the on-line reference manual +# The gnuplot FAQ is available from +# <http://www.uni-karlsruhe.de/~ig25/gnuplot-faq/> +# +# Send comments and requests for help to <info-gnuplot@dartmouth.edu> +# Send bugs, suggestions and mods to <bug-gnuplot@dartmouth.edu> +# +# set terminal postscript landscape noenhanced monochrome dashed defaultplex "Helvetica" 14 +# set output 'bench_gcc.ps' +set noclip points +set clip one +set noclip two +set bar 1.000000 +set border 31 lt -1 lw 1.000 +set xdata +set ydata +set zdata +set x2data +set y2data +set boxwidth +set dummy x,y +set format x "%g" +set format y "%g" +set format x2 "%g" +set format y2 "%g" +set format z "%g" +set angles radians +set nogrid +set key title "" +set key right top Right noreverse box linetype -2 linewidth 1.000 samplen 4 spacing 1 width 0 +set nolabel +set noarrow +set nolinestyle +set nologscale +set logscale x 10 +set offsets 0, 0, 0, 0 +set pointsize 1 +set encoding default +set nopolar +set noparametric +set view 60, 30, 1, 1 +set samples 100, 100 +set isosamples 10, 10 +set surface +set nocontour +set clabel '%8.3g' +set mapping cartesian +set nohidden3d +set cntrparam order 4 +set cntrparam linear +set cntrparam levels auto 5 +set cntrparam points 5 +set size ratio 0 1,1 +set origin 0,0 +set data style linespoints +set function style lines +set xzeroaxis lt -2 lw 1.000 +set x2zeroaxis lt -2 lw 1.000 +set yzeroaxis lt -2 lw 1.000 +set y2zeroaxis lt -2 lw 1.000 +set tics in +set ticslevel 0.5 +set ticscale 1 0.5 +set mxtics default +set mytics default +set mx2tics default +set my2tics default +set xtics border mirror norotate autofreq +set ytics border mirror norotate autofreq +set ztics border nomirror norotate autofreq +set nox2tics +set noy2tics +set title "At x A product " 0.000000,0.000000 "" +set timestamp "" bottom norotate 0.000000,0.000000 "" +set rrange [ * : * ] noreverse nowriteback # (currently [-0:10] ) +set trange [ * : * ] noreverse nowriteback # (currently [-5:5] ) +set urange [ * : * ] noreverse nowriteback # (currently [-5:5] ) +set vrange [ * : * ] noreverse nowriteback # (currently [-5:5] ) +set xlabel "matrix size" 0.000000,0.000000 "" +set x2label "" 0.000000,0.000000 "" +set timefmt "%d/%m/%y\n%H:%M" +set xrange [ 10 : 1000 ] noreverse nowriteback +set x2range [ * : * ] noreverse nowriteback # (currently [-10:10] ) +set ylabel "MFLOPS" 0.000000,0.000000 "" +set y2label "" 0.000000,0.000000 "" +set yrange [ * : * ] noreverse nowriteback # (currently [-10:10] ) +set y2range [ * : * ] noreverse nowriteback # (currently [-10:10] ) +set zlabel "" 0.000000,0.000000 "" +set zrange [ * : * ] noreverse nowriteback # (currently [-10:10] ) +set zero 1e-08 +set lmargin -1 +set bmargin -1 +set rmargin -1 +set tmargin -1 +set locale "C" +set xrange [10:1000] +##set yrange [0:400] diff --git a/bench/btl/data/axpy.hh b/bench/btl/data/axpy.hh new file mode 100644 index 000000000..9f53397e3 --- /dev/null +++ b/bench/btl/data/axpy.hh @@ -0,0 +1,108 @@ +#!/usr/bin/gnuplot -persist +# +# +# G N U P L O T +# Linux version 3.7 +# patchlevel 0 +# last modified Thu Jan 14 19:34:53 BST 1999 +# +# Copyright(C) 1986 - 1993, 1998, 1999 +# Thomas Williams, Colin Kelley and many others +# +# Type `help` to access the on-line reference manual +# The gnuplot FAQ is available from +# <http://www.uni-karlsruhe.de/~ig25/gnuplot-faq/> +# +# Send comments and requests for help to <info-gnuplot@dartmouth.edu> +# Send bugs, suggestions and mods to <bug-gnuplot@dartmouth.edu> +# +# set terminal postscript landscape noenhanced monochrome dashed defaultplex "Helvetica" 14 +# set output 'bench_gcc.ps' +set noclip points +set clip one +set noclip two +set bar 1.000000 +set border 31 lt -1 lw 1.000 +set xdata +set ydata +set zdata +set x2data +set y2data +set boxwidth +set dummy x,y +set format x "%g" +set format y "%g" +set format x2 "%g" +set format y2 "%g" +set format z "%g" +set angles radians +set nogrid +set key title "" +set key right top Right noreverse box linetype -2 linewidth 1.000 samplen 4 spacing 1 width 0 +set nolabel +set noarrow +set nolinestyle +set nologscale +set logscale x 10 +set offsets 0, 0, 0, 0 +set pointsize 1 +set encoding default +set nopolar +set noparametric +set view 60, 30, 1, 1 +set samples 100, 100 +set isosamples 10, 10 +set surface +set nocontour +set clabel '%8.3g' +set mapping cartesian +set nohidden3d +set cntrparam order 4 +set cntrparam linear +set cntrparam levels auto 5 +set cntrparam points 5 +set size ratio 0 1,1 +set origin 0,0 +set data style linespoints +set function style lines +set xzeroaxis lt -2 lw 1.000 +set x2zeroaxis lt -2 lw 1.000 +set yzeroaxis lt -2 lw 1.000 +set y2zeroaxis lt -2 lw 1.000 +set tics in +set ticslevel 0.5 +set ticscale 1 0.5 +set mxtics default +set mytics default +set mx2tics default +set my2tics default +set xtics border mirror norotate autofreq +set ytics border mirror norotate autofreq +set ztics border nomirror norotate autofreq +set nox2tics +set noy2tics +set title "Y+=alpha*X " 0.000000,0.000000 "" +set timestamp "" bottom norotate 0.000000,0.000000 "" +set rrange [ * : * ] noreverse nowriteback # (currently [-0:10] ) +set trange [ * : * ] noreverse nowriteback # (currently [-5:5] ) +set urange [ * : * ] noreverse nowriteback # (currently [-5:5] ) +set vrange [ * : * ] noreverse nowriteback # (currently [-5:5] ) +set xlabel "vector size" 0.000000,0.000000 "" +set x2label "" 0.000000,0.000000 "" +set timefmt "%d/%m/%y\n%H:%M" +set xrange [ 10 : 1000 ] noreverse nowriteback +set x2range [ * : * ] noreverse nowriteback # (currently [-10:10] ) +set ylabel "MFLOPS" 0.000000,0.000000 "" +set y2label "" 0.000000,0.000000 "" +set yrange [ * : * ] noreverse nowriteback # (currently [-10:10] ) +set y2range [ * : * ] noreverse nowriteback # (currently [-10:10] ) +set zlabel "" 0.000000,0.000000 "" +set zrange [ * : * ] noreverse nowriteback # (currently [-10:10] ) +set zero 1e-08 +set lmargin -1 +set bmargin -1 +set rmargin -1 +set tmargin -1 +set locale "C" +set xrange [1:1000000] +##set yrange [0:550] diff --git a/bench/btl/data/go_mean b/bench/btl/data/go_mean new file mode 100755 index 000000000..80203afc4 --- /dev/null +++ b/bench/btl/data/go_mean @@ -0,0 +1,9 @@ +mkdir $1 +##cp ../libs/*/*.dat $1 + +source mk_mean_script.sh axpy $1 11 2500 100000 250000 > $1/axpy.html +source mk_mean_script.sh matrix_vector $1 11 50 300 500 > $1/matrix_vector.html +source mk_mean_script.sh matrix_matrix $1 11 100 300 500 > $1/matrix_matrix.html +source mk_mean_script.sh aat $1 11 100 300 1000 > $1/aat.html +source mk_mean_script.sh ata $1 11 100 300 1000 > $1/ata.html + diff --git a/bench/btl/data/matrix_matrix.hh b/bench/btl/data/matrix_matrix.hh new file mode 100644 index 000000000..42e97d5c1 --- /dev/null +++ b/bench/btl/data/matrix_matrix.hh @@ -0,0 +1,108 @@ +#!/usr/bin/gnuplot -persist +# +# +# G N U P L O T +# Linux version 3.7 +# patchlevel 0 +# last modified Thu Jan 14 19:34:53 BST 1999 +# +# Copyright(C) 1986 - 1993, 1998, 1999 +# Thomas Williams, Colin Kelley and many others +# +# Type `help` to access the on-line reference manual +# The gnuplot FAQ is available from +# <http://www.uni-karlsruhe.de/~ig25/gnuplot-faq/> +# +# Send comments and requests for help to <info-gnuplot@dartmouth.edu> +# Send bugs, suggestions and mods to <bug-gnuplot@dartmouth.edu> +# +# set terminal postscript landscape noenhanced monochrome dashed defaultplex "Helvetica" 14 +# set output 'bench_gcc.ps' +set noclip points +set clip one +set noclip two +set bar 1.000000 +set border 31 lt -1 lw 1.000 +set xdata +set ydata +set zdata +set x2data +set y2data +set boxwidth +set dummy x,y +set format x "%g" +set format y "%g" +set format x2 "%g" +set format y2 "%g" +set format z "%g" +set angles radians +set nogrid +set key title "" +set key right top Right noreverse box linetype -2 linewidth 1.000 samplen 4 spacing 1 width 0 +set nolabel +set noarrow +set nolinestyle +set nologscale +set logscale x 10 +set offsets 0, 0, 0, 0 +set pointsize 1 +set encoding default +set nopolar +set noparametric +set view 60, 30, 1, 1 +set samples 100, 100 +set isosamples 10, 10 +set surface +set nocontour +set clabel '%8.3g' +set mapping cartesian +set nohidden3d +set cntrparam order 4 +set cntrparam linear +set cntrparam levels auto 5 +set cntrparam points 5 +set size ratio 0 1,1 +set origin 0,0 +set data style linespoints +set function style lines +set xzeroaxis lt -2 lw 1.000 +set x2zeroaxis lt -2 lw 1.000 +set yzeroaxis lt -2 lw 1.000 +set y2zeroaxis lt -2 lw 1.000 +set tics in +set ticslevel 0.5 +set ticscale 1 0.5 +set mxtics default +set mytics default +set mx2tics default +set my2tics default +set xtics border mirror norotate autofreq +set ytics border mirror norotate autofreq +set ztics border nomirror norotate autofreq +set nox2tics +set noy2tics +set title "matrix matrix product " 0.000000,0.000000 "" +set timestamp "" bottom norotate 0.000000,0.000000 "" +set rrange [ * : * ] noreverse nowriteback # (currently [-0:10] ) +set trange [ * : * ] noreverse nowriteback # (currently [-5:5] ) +set urange [ * : * ] noreverse nowriteback # (currently [-5:5] ) +set vrange [ * : * ] noreverse nowriteback # (currently [-5:5] ) +set xlabel "matrix size" 0.000000,0.000000 "" +set x2label "" 0.000000,0.000000 "" +set timefmt "%d/%m/%y\n%H:%M" +set xrange [ 10 : 1000 ] noreverse nowriteback +set x2range [ * : * ] noreverse nowriteback # (currently [-10:10] ) +set ylabel "MFLOPS" 0.000000,0.000000 "" +set y2label "" 0.000000,0.000000 "" +set yrange [ * : * ] noreverse nowriteback # (currently [-10:10] ) +set y2range [ * : * ] noreverse nowriteback # (currently [-10:10] ) +set zlabel "" 0.000000,0.000000 "" +set zrange [ * : * ] noreverse nowriteback # (currently [-10:10] ) +set zero 1e-08 +set lmargin -1 +set bmargin -1 +set rmargin -1 +set tmargin -1 +set locale "C" +set xrange [1:1000] +##set yrange [0:400] diff --git a/bench/btl/data/matrix_vector.hh b/bench/btl/data/matrix_vector.hh new file mode 100644 index 000000000..00e8c7c33 --- /dev/null +++ b/bench/btl/data/matrix_vector.hh @@ -0,0 +1,108 @@ +#!/usr/bin/gnuplot -persist +# +# +# G N U P L O T +# Linux version 3.7 +# patchlevel 0 +# last modified Thu Jan 14 19:34:53 BST 1999 +# +# Copyright(C) 1986 - 1993, 1998, 1999 +# Thomas Williams, Colin Kelley and many others +# +# Type `help` to access the on-line reference manual +# The gnuplot FAQ is available from +# <http://www.uni-karlsruhe.de/~ig25/gnuplot-faq/> +# +# Send comments and requests for help to <info-gnuplot@dartmouth.edu> +# Send bugs, suggestions and mods to <bug-gnuplot@dartmouth.edu> +# +# set terminal postscript landscape noenhanced monochrome dashed defaultplex "Helvetica" 14 +# set output 'bench_gcc.ps' +set noclip points +set clip one +set noclip two +set bar 1.000000 +set border 31 lt -1 lw 1.000 +set xdata +set ydata +set zdata +set x2data +set y2data +set boxwidth +set dummy x,y +set format x "%g" +set format y "%g" +set format x2 "%g" +set format y2 "%g" +set format z "%g" +set angles radians +set nogrid +set key title "" +set key right top Right noreverse box linetype -2 linewidth 1.000 samplen 4 spacing 1 width 0 +set nolabel +set noarrow +set nolinestyle +set nologscale +set logscale x 10 +set offsets 0, 0, 0, 0 +set pointsize 1 +set encoding default +set nopolar +set noparametric +set view 60, 30, 1, 1 +set samples 100, 100 +set isosamples 10, 10 +set surface +set nocontour +set clabel '%8.3g' +set mapping cartesian +set nohidden3d +set cntrparam order 4 +set cntrparam linear +set cntrparam levels auto 5 +set cntrparam points 5 +set size ratio 0 1,1 +set origin 0,0 +set data style linespoints +set function style lines +set xzeroaxis lt -2 lw 1.000 +set x2zeroaxis lt -2 lw 1.000 +set yzeroaxis lt -2 lw 1.000 +set y2zeroaxis lt -2 lw 1.000 +set tics in +set ticslevel 0.5 +set ticscale 1 0.5 +set mxtics default +set mytics default +set mx2tics default +set my2tics default +set xtics border mirror norotate autofreq +set ytics border mirror norotate autofreq +set ztics border nomirror norotate autofreq +set nox2tics +set noy2tics +set title "matrix vector product " 0.000000,0.000000 "" +set timestamp "" bottom norotate 0.000000,0.000000 "" +set rrange [ * : * ] noreverse nowriteback # (currently [-0:10] ) +set trange [ * : * ] noreverse nowriteback # (currently [-5:5] ) +set urange [ * : * ] noreverse nowriteback # (currently [-5:5] ) +set vrange [ * : * ] noreverse nowriteback # (currently [-5:5] ) +set xlabel "matrix size" 0.000000,0.000000 "" +set x2label "" 0.000000,0.000000 "" +set timefmt "%d/%m/%y\n%H:%M" +set xrange [ 10 : 1000 ] noreverse nowriteback +set x2range [ * : * ] noreverse nowriteback # (currently [-10:10] ) +set ylabel "MFLOPS" 0.000000,0.000000 "" +set y2label "" 0.000000,0.000000 "" +set yrange [ * : * ] noreverse nowriteback # (currently [-10:10] ) +set y2range [ * : * ] noreverse nowriteback # (currently [-10:10] ) +set zlabel "" 0.000000,0.000000 "" +set zrange [ * : * ] noreverse nowriteback # (currently [-10:10] ) +set zero 1e-08 +set lmargin -1 +set bmargin -1 +set rmargin -1 +set tmargin -1 +set locale "C" +set xrange [1:1000] +##set yrange [0:400] diff --git a/bench/btl/data/mean.cxx b/bench/btl/data/mean.cxx new file mode 100644 index 000000000..96d37dc4a --- /dev/null +++ b/bench/btl/data/mean.cxx @@ -0,0 +1,207 @@ +//===================================================== +// File : mean.cxx +// Author : L. Plagne <laurent.plagne@edf.fr)> +// Copyright (C) EDF R&D, lun sep 30 14:23:15 CEST 2002 +//===================================================== +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +#include "utilities.h" +#include <vector> +#include <string> +#include <iostream> +#include <fstream> +#include "bench_parameter.hh" +#include <set> + +using namespace std; + +void read_xy_file(const string & filename, vector<int> & tab_sizes, vector<double> & tab_mflops); +double mean_calc(const vector<int> & tab_sizes, const vector<double> & tab_mflops, const int size_min, const int size_max); + +class Lib_Mean{ + +public: + Lib_Mean( void ):_lib_name(),_mean_in_cache(),_mean_out_of_cache(){ + MESSAGE("Lib_mean Default Ctor"); + MESSAGE("!!! should not be used"); + exit(0); + } + Lib_Mean(const string & name, const double & mic, const double & moc):_lib_name(name),_mean_in_cache(mic),_mean_out_of_cache(moc){ + MESSAGE("Lib_mean Ctor"); + } + Lib_Mean(const Lib_Mean & lm):_lib_name(lm._lib_name),_mean_in_cache(lm._mean_in_cache),_mean_out_of_cache(lm._mean_out_of_cache){ + MESSAGE("Lib_mean Copy Ctor"); + } + ~Lib_Mean( void ){ + MESSAGE("Lib_mean Dtor"); + } + + double _mean_in_cache; + double _mean_out_of_cache; + string _lib_name; + + bool operator < ( const Lib_Mean &right) const + { + //return ( this->_mean_out_of_cache > right._mean_out_of_cache) ; + return ( this->_mean_in_cache > right._mean_in_cache) ; + } + +}; + + +int main( int argc , char *argv[] ) +{ + + if (argc<6){ + INFOS("!!! Error ... usage : main what mic Mic moc Moc filename1 finename2..."); + exit(0); + } + INFOS(argc); + + int min_in_cache=atoi(argv[2]); + int max_in_cache=atoi(argv[3]); + int min_out_of_cache=atoi(argv[4]); + int max_out_of_cache=atoi(argv[5]); + + + multiset<Lib_Mean> s_lib_mean ; + + for (int i=6;i<argc;i++){ + + string filename=argv[i]; + + INFOS(filename); + + double mic=0; + double moc=0; + + { + + vector<int> tab_sizes; + vector<double> tab_mflops; + + read_xy_file(filename,tab_sizes,tab_mflops); + + mic=mean_calc(tab_sizes,tab_mflops,min_in_cache,max_in_cache); + moc=mean_calc(tab_sizes,tab_mflops,min_out_of_cache,max_out_of_cache); + + Lib_Mean cur_lib_mean(filename,mic,moc); + + s_lib_mean.insert(cur_lib_mean); + + } + + } + + + cout << "<TABLE BORDER CELLPADDING=2>" << endl ; + cout << " <TR>" << endl ; + cout << " <TH ALIGN=CENTER> " << argv[1] << " </TH>" << endl ; + cout << " <TH ALIGN=CENTER> <a href=""#mean_marker""> in cache <BR> mean perf <BR> Mflops </a></TH>" << endl ; + cout << " <TH ALIGN=CENTER> in cache <BR> % best </TH>" << endl ; + cout << " <TH ALIGN=CENTER> <a href=""#mean_marker""> out of cache <BR> mean perf <BR> Mflops </a></TH>" << endl ; + cout << " <TH ALIGN=CENTER> out of cache <BR> % best </TH>" << endl ; + cout << " <TH ALIGN=CENTER> details </TH>" << endl ; + cout << " <TH ALIGN=CENTER> comments </TH>" << endl ; + cout << " </TR>" << endl ; + + set<Lib_Mean>::iterator is ; + + is=s_lib_mean.begin(); + Lib_Mean best(*is); + + + for (is=s_lib_mean.begin(); is!=s_lib_mean.end() ; is++){ + + cout << " <TR>" << endl ; + cout << " <TD> " << is->_lib_name << " </TD>" << endl ; + cout << " <TD> " << is->_mean_in_cache << " </TD>" << endl ; + cout << " <TD> " << 100*(is->_mean_in_cache/best._mean_in_cache) << " </TD>" << endl ; + cout << " <TD> " << is->_mean_out_of_cache << " </TD>" << endl ; + cout << " <TD> " << 100*(is->_mean_out_of_cache/best._mean_out_of_cache) << " </TD>" << endl ; + cout << " <TD> " << + "<a href=\"#"<<is->_lib_name<<"_"<<argv[1]<<"\">snippet</a>/" + "<a href=\"#"<<is->_lib_name<<"_flags\">flags</a> </TD>" << endl ; + cout << " <TD> " << + "<a href=\"#"<<is->_lib_name<<"_comments\">click here</a> </TD>" << endl ; + cout << " </TR>" << endl ; + + } + + cout << "</TABLE>" << endl ; + + ofstream output_file ("../order_lib",ios::out) ; + + for (is=s_lib_mean.begin(); is!=s_lib_mean.end() ; is++){ + output_file << is->_lib_name << endl ; + } + + output_file.close(); + +} + +void read_xy_file(const string & filename, vector<int> & tab_sizes, vector<double> & tab_mflops){ + + ifstream input_file (filename.c_str(),ios::in) ; + + if (!input_file){ + INFOS("!!! Error opening "<<filename); + exit(0); + } + + int nb_point=0; + int size=0; + double mflops=0; + + while (input_file >> size >> mflops ){ + nb_point++; + tab_sizes.push_back(size); + tab_mflops.push_back(mflops); + } + SCRUTE(nb_point); + + input_file.close(); +} + +double mean_calc(const vector<int> & tab_sizes, const vector<double> & tab_mflops, const int size_min, const int size_max){ + + int size=tab_sizes.size(); + int nb_sample=0; + double mean=0.0; + + for (int i=0;i<size;i++){ + + + if ((tab_sizes[i]>=size_min)&&(tab_sizes[i]<=size_max)){ + + nb_sample++; + mean+=tab_mflops[i]; + + } + + + } + + if (nb_sample==0){ + INFOS("no data for mean calculation"); + return 0.0; + } + + return mean/nb_sample; +} + + + + diff --git a/bench/btl/data/mk_gnuplot_script.sh b/bench/btl/data/mk_gnuplot_script.sh new file mode 100644 index 000000000..2ca7b5cb5 --- /dev/null +++ b/bench/btl/data/mk_gnuplot_script.sh @@ -0,0 +1,68 @@ +#! /bin/bash +WHAT=$1 +DIR=$2 +echo $WHAT script generation +cat $WHAT.hh > $WHAT.gnuplot + +DATA_FILE=`find $DIR -name "*.dat" | grep $WHAT` + +echo plot \\ >> $WHAT.gnuplot + +for FILE in $DATA_FILE +do + LAST=$FILE +done + +echo LAST=$LAST + +for FILE in $DATA_FILE +do + if [ $FILE != $LAST ] + then + BASE=${FILE##*/} ; BASE=${FILE##*/} ; AVANT=bench_${WHAT}_ ; REDUC=${BASE##*$AVANT} ; TITLE=${REDUC%.dat} + echo "'"$FILE"'" title "'"$TITLE"'" ",\\" >> $WHAT.gnuplot + fi +done +BASE=${LAST##*/} ; BASE=${FILE##*/} ; AVANT=bench_${WHAT}_ ; REDUC=${BASE##*$AVANT} ; TITLE=${REDUC%.dat} +echo "'"$LAST"'" title "'"$TITLE"'" >> $WHAT.gnuplot + +#echo set term postscript color >> $WHAT.gnuplot +#echo set output "'"$WHAT.ps"'" >> $WHAT.gnuplot +echo set term pbm small color >> $WHAT.gnuplot +echo set output "'"$WHAT.ppm"'" >> $WHAT.gnuplot +echo plot \\ >> $WHAT.gnuplot + +for FILE in $DATA_FILE +do + if [ $FILE != $LAST ] + then + BASE=${FILE##*/} ; BASE=${FILE##*/} ; AVANT=bench_${WHAT}_ ; REDUC=${BASE##*$AVANT} ; TITLE=${REDUC%.dat} + echo "'"$FILE"'" title "'"$TITLE"'" ",\\" >> $WHAT.gnuplot + fi +done +BASE=${LAST##*/} ; BASE=${FILE##*/} ; AVANT=bench_${WHAT}_ ; REDUC=${BASE##*$AVANT} ; TITLE=${REDUC%.dat} +echo "'"$LAST"'" title "'"$TITLE"'" >> $WHAT.gnuplot + +echo set term jpeg large >> $WHAT.gnuplot +echo set output "'"$WHAT.jpg"'" >> $WHAT.gnuplot +echo plot \\ >> $WHAT.gnuplot + +for FILE in $DATA_FILE +do + if [ $FILE != $LAST ] + then + BASE=${FILE##*/} ; BASE=${FILE##*/} ; AVANT=bench_${WHAT}_ ; REDUC=${BASE##*$AVANT} ; TITLE=${REDUC%.dat} + echo "'"$FILE"'" title "'"$TITLE"'" ",\\" >> $WHAT.gnuplot + fi +done +BASE=${LAST##*/} ; BASE=${FILE##*/} ; AVANT=bench_${WHAT}_ ; REDUC=${BASE##*$AVANT} ; TITLE=${REDUC%.dat} +echo "'"$LAST"'" title "'"$TITLE"'" >> $WHAT.gnuplot + + +gnuplot -persist < $WHAT.gnuplot + +rm $WHAT.gnuplot + + + + diff --git a/bench/btl/data/mk_mean_script.sh b/bench/btl/data/mk_mean_script.sh new file mode 100644 index 000000000..bc6821cf1 --- /dev/null +++ b/bench/btl/data/mk_mean_script.sh @@ -0,0 +1,39 @@ +#! /bin/bash +WHAT=$1 +DIR=$2 +MINIC=$3 +MAXIC=$4 +MINOC=$5 +MAXOC=$6 + +WORK_DIR=tmp +mkdir $WORK_DIR + +DATA_FILE=`find $DIR -name "*.dat" | grep _${WHAT}` +echo +for FILE in $DATA_FILE +do + ##echo hello world + ##echo "mk_mean_script1" ${FILE} + BASE=${FILE##*/} ; BASE=${FILE##*/} ; AVANT=bench_${WHAT}_ ; REDUC=${BASE##*$AVANT} ; TITLE=${REDUC%.dat} + + ##echo "mk_mean_script1" ${TITLE} + cp $FILE ${WORK_DIR}/${TITLE} + +done + +cd $WORK_DIR +../main $1 $3 $4 $5 $6 * +../mk_new_gnuplot.sh $1 $2 +rm -f *.gnuplot +cd .. + +rm -R $WORK_DIR + + + + + + + + diff --git a/bench/btl/data/mk_new_gnuplot.sh b/bench/btl/data/mk_new_gnuplot.sh new file mode 100755 index 000000000..ba86b2884 --- /dev/null +++ b/bench/btl/data/mk_new_gnuplot.sh @@ -0,0 +1,45 @@ +#! /bin/bash +WHAT=$1 +DIR=$2 +cat ../${WHAT}.hh > ${WHAT}.gnuplot + +DATA_FILE=`cat ../order_lib` + +echo plot \\ >> $WHAT.gnuplot + +for FILE in $DATA_FILE +do + LAST=$FILE +done + + +for FILE in $DATA_FILE +do + if [ $FILE != $LAST ] + then + echo "'"$FILE"'" ",\\" >> $WHAT.gnuplot + fi +done +echo "'"$LAST"'" >> $WHAT.gnuplot + +echo set term postscript color >> $WHAT.gnuplot +echo set output "'"../${DIR}/$WHAT.ps"'" >> $WHAT.gnuplot +#echo set term pbm color >> $WHAT.gnuplot +#echo set output "'"../${DIR}/$WHAT.ppm"'" >> $WHAT.gnuplot +echo plot \\ >> $WHAT.gnuplot +for FILE in $DATA_FILE +do + if [ $FILE != $LAST ] + then + echo "'"$FILE"'" ",\\" >> $WHAT.gnuplot + fi +done +echo "'"$LAST"'" >> $WHAT.gnuplot + +gnuplot -persist < $WHAT.gnuplot + +rm $WHAT.gnuplot + + + + diff --git a/bench/btl/data/order_lib b/bench/btl/data/order_lib new file mode 100644 index 000000000..5ea998a2e --- /dev/null +++ b/bench/btl/data/order_lib @@ -0,0 +1,8 @@ +eigen2 +C_BLAS +STL +C +gmm +ublas +blitz +F77 diff --git a/bench/btl/data/regularize.cxx b/bench/btl/data/regularize.cxx new file mode 100644 index 000000000..eea2b8b85 --- /dev/null +++ b/bench/btl/data/regularize.cxx @@ -0,0 +1,131 @@ +//===================================================== +// File : regularize.cxx +// Author : L. Plagne <laurent.plagne@edf.fr)> +// Copyright (C) EDF R&D, lun sep 30 14:23:15 CEST 2002 +//===================================================== +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +#include "utilities.h" +#include <vector> +#include <string> +#include <iostream> +#include <fstream> +#include "bench_parameter.hh" +#include <set> + +using namespace std; + +void read_xy_file(const string & filename, vector<int> & tab_sizes, vector<double> & tab_mflops); +void regularize_curve(const string & filename, + const vector<double> & tab_mflops, + const vector<int> & tab_sizes, + int start_cut_size, int stop_cut_size); +///////////////////////////////////////////////////////////////////////////////////////////////// + +int main( int argc , char *argv[] ) +{ + + // input data + + if (argc<4){ + INFOS("!!! Error ... usage : main filename start_cut_size stop_cut_size regularize_filename"); + exit(0); + } + INFOS(argc); + + int start_cut_size=atoi(argv[2]); + int stop_cut_size=atoi(argv[3]); + + string filename=argv[1]; + string regularize_filename=argv[4]; + + INFOS(filename); + INFOS("start_cut_size="<<start_cut_size); + + vector<int> tab_sizes; + vector<double> tab_mflops; + + read_xy_file(filename,tab_sizes,tab_mflops); + + // regularizeing + + regularize_curve(regularize_filename,tab_mflops,tab_sizes,start_cut_size,stop_cut_size); + + +} + +////////////////////////////////////////////////////////////////////////////////////// + +void regularize_curve(const string & filename, + const vector<double> & tab_mflops, + const vector<int> & tab_sizes, + int start_cut_size, int stop_cut_size) +{ + int size=tab_mflops.size(); + ofstream output_file (filename.c_str(),ios::out) ; + + int i=0; + + while(tab_sizes[i]<start_cut_size){ + + output_file << tab_sizes[i] << " " << tab_mflops[i] << endl ; + i++; + + } + + output_file << endl ; + + while(tab_sizes[i]<stop_cut_size){ + + i++; + + } + + while(i<size){ + + output_file << tab_sizes[i] << " " << tab_mflops[i] << endl ; + i++; + + } + + output_file.close(); + +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void read_xy_file(const string & filename, vector<int> & tab_sizes, vector<double> & tab_mflops){ + + ifstream input_file (filename.c_str(),ios::in) ; + + if (!input_file){ + INFOS("!!! Error opening "<<filename); + exit(0); + } + + int nb_point=0; + int size=0; + double mflops=0; + + while (input_file >> size >> mflops ){ + nb_point++; + tab_sizes.push_back(size); + tab_mflops.push_back(mflops); + } + SCRUTE(nb_point); + + input_file.close(); +} + diff --git a/bench/btl/data/smooth.cxx b/bench/btl/data/smooth.cxx new file mode 100644 index 000000000..e5270cc32 --- /dev/null +++ b/bench/btl/data/smooth.cxx @@ -0,0 +1,198 @@ +//===================================================== +// File : smooth.cxx +// Author : L. Plagne <laurent.plagne@edf.fr)> +// Copyright (C) EDF R&D, lun sep 30 14:23:15 CEST 2002 +//===================================================== +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +#include "utilities.h" +#include <vector> +#include <deque> +#include <string> +#include <iostream> +#include <fstream> +#include "bench_parameter.hh" +#include <set> + +using namespace std; + +void read_xy_file(const string & filename, vector<int> & tab_sizes, vector<double> & tab_mflops); +void write_xy_file(const string & filename, vector<int> & tab_sizes, vector<double> & tab_mflops); +void smooth_curve(const vector<double> & tab_mflops, vector<double> & smooth_tab_mflops,int window_half_width); +void centered_smooth_curve(const vector<double> & tab_mflops, vector<double> & smooth_tab_mflops,int window_half_width); + +///////////////////////////////////////////////////////////////////////////////////////////////// + +int main( int argc , char *argv[] ) +{ + + // input data + + if (argc<3){ + INFOS("!!! Error ... usage : main filename window_half_width smooth_filename"); + exit(0); + } + INFOS(argc); + + int window_half_width=atoi(argv[2]); + + string filename=argv[1]; + string smooth_filename=argv[3]; + + INFOS(filename); + INFOS("window_half_width="<<window_half_width); + + vector<int> tab_sizes; + vector<double> tab_mflops; + + read_xy_file(filename,tab_sizes,tab_mflops); + + // smoothing + + vector<double> smooth_tab_mflops; + + //smooth_curve(tab_mflops,smooth_tab_mflops,window_half_width); + centered_smooth_curve(tab_mflops,smooth_tab_mflops,window_half_width); + + // output result + + write_xy_file(smooth_filename,tab_sizes,smooth_tab_mflops); + + +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +template<class VECTOR> +double weighted_mean(const VECTOR & data) +{ + + double mean=0.0; + + for (int i=0 ; i<data.size() ; i++){ + + mean+=data[i]; + + } + + return mean/double(data.size()) ; + +} + + + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + +void smooth_curve(const vector<double> & tab_mflops, vector<double> & smooth_tab_mflops,int window_half_width){ + + int window_width=2*window_half_width+1; + + int size=tab_mflops.size(); + + vector<double> sample(window_width); + + for (int i=0 ; i < size ; i++){ + + for ( int j=0 ; j < window_width ; j++ ){ + + int shifted_index=i+j-window_half_width; + if (shifted_index<0) shifted_index=0; + if (shifted_index>size-1) shifted_index=size-1; + sample[j]=tab_mflops[shifted_index]; + + } + + smooth_tab_mflops.push_back(weighted_mean(sample)); + + } + +} + +void centered_smooth_curve(const vector<double> & tab_mflops, vector<double> & smooth_tab_mflops,int window_half_width){ + + int max_window_width=2*window_half_width+1; + + int size=tab_mflops.size(); + + + for (int i=0 ; i < size ; i++){ + + deque<double> sample; + + + sample.push_back(tab_mflops[i]); + + for ( int j=1 ; j <= window_half_width ; j++ ){ + + int before=i-j; + int after=i+j; + + if ((before>=0)&&(after<size)) // inside of the vector + { + sample.push_front(tab_mflops[before]); + sample.push_back(tab_mflops[after]); + } + } + + smooth_tab_mflops.push_back(weighted_mean(sample)); + + } + +} + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void write_xy_file(const string & filename, vector<int> & tab_sizes, vector<double> & tab_mflops){ + + ofstream output_file (filename.c_str(),ios::out) ; + + for (int i=0 ; i < tab_sizes.size() ; i++) + { + output_file << tab_sizes[i] << " " << tab_mflops[i] << endl ; + } + + output_file.close(); + +} + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void read_xy_file(const string & filename, vector<int> & tab_sizes, vector<double> & tab_mflops){ + + ifstream input_file (filename.c_str(),ios::in) ; + + if (!input_file){ + INFOS("!!! Error opening "<<filename); + exit(0); + } + + int nb_point=0; + int size=0; + double mflops=0; + + while (input_file >> size >> mflops ){ + nb_point++; + tab_sizes.push_back(size); + tab_mflops.push_back(mflops); + } + SCRUTE(nb_point); + + input_file.close(); +} + diff --git a/bench/btl/data/smooth_all.sh b/bench/btl/data/smooth_all.sh new file mode 100755 index 000000000..3e5bfdf47 --- /dev/null +++ b/bench/btl/data/smooth_all.sh @@ -0,0 +1,68 @@ +#! /bin/bash +ORIG_DIR=$1 +SMOOTH_DIR=${ORIG_DIR}_smooth +mkdir ${SMOOTH_DIR} + +AXPY_FILE=`find ${ORIG_DIR} -name "*.dat" | grep axpy` +for FILE in ${AXPY_FILE} +do + echo $FILE + BASE=${FILE##*/} + ./smooth ${ORIG_DIR}/${BASE} 4 ${SMOOTH_DIR}/${BASE}_tmp + ./regularize ${SMOOTH_DIR}/${BASE}_tmp 2500 15000 ${SMOOTH_DIR}/${BASE} + rm -f ${SMOOTH_DIR}/${BASE}_tmp +done + + +MATRIX_VECTOR_FILE=`find ${ORIG_DIR} -name "*.dat" | grep matrix_vector` +for FILE in ${MATRIX_VECTOR_FILE} +do + echo $FILE + BASE=${FILE##*/} + ./smooth ${ORIG_DIR}/${BASE} 4 ${SMOOTH_DIR}/${BASE}_tmp + ./regularize ${SMOOTH_DIR}/${BASE}_tmp 50 180 ${SMOOTH_DIR}/${BASE} + rm -f ${SMOOTH_DIR}/${BASE}_tmp +done + +MATRIX_MATRIX_FILE=`find ${ORIG_DIR} -name "*.dat" | grep matrix_matrix` +for FILE in ${MATRIX_MATRIX_FILE} +do + echo $FILE + BASE=${FILE##*/} + ./smooth ${ORIG_DIR}/${BASE} 4 ${SMOOTH_DIR}/${BASE} +done + +AAT_FILE=`find ${ORIG_DIR} -name "*.dat" | grep _aat` +for FILE in ${AAT_FILE} +do + echo $FILE + BASE=${FILE##*/} + ./smooth ${ORIG_DIR}/${BASE} 4 ${SMOOTH_DIR}/${BASE} +done + + +ATA_FILE=`find ${ORIG_DIR} -name "*.dat" | grep _ata` +for FILE in ${ATA_FILE} +do + echo $FILE + BASE=${FILE##*/} + ./smooth ${ORIG_DIR}/${BASE} 4 ${SMOOTH_DIR}/${BASE} +done + +### no smoothing for tinyvector and matrices libs + +TINY_BLITZ_FILE=`find ${ORIG_DIR} -name "*.dat" | grep tiny_blitz` +for FILE in ${TINY_BLITZ_FILE} +do + echo $FILE + BASE=${FILE##*/} + cp ${ORIG_DIR}/${BASE} ${SMOOTH_DIR}/${BASE} +done + +TVMET_FILE=`find ${ORIG_DIR} -name "*.dat" | grep tvmet` +for FILE in ${TVMET_FILE} +do + echo $FILE + BASE=${FILE##*/} + cp ${ORIG_DIR}/${BASE} ${SMOOTH_DIR}/${BASE} +done |