[pypy-commit] extradoc extradoc: add remaining scimark lua benchmarks to runner

hakanardo noreply at buildbot.pypy.org
Tue Aug 14 19:53:08 CEST 2012


Author: Hakan Ardo <hakan at debian.org>
Branch: extradoc
Changeset: r4572:802a55723103
Date: 2012-08-14 19:52 +0200
http://bitbucket.org/pypy/extradoc/changeset/802a55723103/

Log:	add remaining scimark lua benchmarks to runner

diff --git a/talk/iwtc11/benchmarks/benchmark.sh b/talk/iwtc11/benchmarks/benchmark.sh
--- a/talk/iwtc11/benchmarks/benchmark.sh
+++ b/talk/iwtc11/benchmarks/benchmark.sh
@@ -27,6 +27,13 @@
 elif [[ "$1" == luajit* ]]; then
     $* runner.lua SOR 100 32768
     $* runner.lua SOR 1000 256
+    $* runner.lua SparseMatMult 1000 5000 262144
+    $* runner.lua SparseMatMult 100000 1000000 1024
+    $* runner.lua MonteCarlo 268435456
+    $* runner.lua LU 100 4096
+    $* runner.lua LU 1000 2
+    $* runner.lua FFT 1024 32768
+    $* runner.lua FFT 1048576 2
 else
     if [ "$1" == "python2.7" ]; then
         EXTRA_OPTS='-w 0 -n 1'
diff --git a/talk/iwtc11/benchmarks/runner.lua b/talk/iwtc11/benchmarks/runner.lua
--- a/talk/iwtc11/benchmarks/runner.lua
+++ b/talk/iwtc11/benchmarks/runner.lua
@@ -6,11 +6,36 @@
 
 function benchmarks.SOR(n, cycles)
     n, cycles = tonumber(n), tonumber(cycles)
-    local mat = scimark.random_matrix(n, n)
-    scimark.sor_run(mat, n, n, cycles, 1.25)
+    scimark.benchmarks.SOR(n)(cycles)
     return string.format('SOR(%d, %d)', n, cycles)
 end
 
+function benchmarks.SparseMatMult(n, nz, cycles)
+    n, nz, cycles = tonumber(n), tonumber(nz), tonumber(cycles)
+    scimark.benchmarks.SPARSE(n, nz)(cycles)
+    return string.format('SparseMatMult(%d,%d,%d)', n, nz, cycles)
+end
+
+function benchmarks.MonteCarlo(cycles)
+    cycles = tonumber(cycles)
+    scimark.benchmarks.MC()(cycles)
+    return string.format('MonteCarlo(%d)', cycles)
+end
+
+function benchmarks.LU(n, cycles)
+    n, cycles = tonumber(n), tonumber(cycles)
+    scimark.benchmarks.LU(n)(cycles)
+    return string.format('LU(%d, %d)', n, cycles)
+end
+
+function benchmarks.FFT(n, cycles)
+    n, cycles = tonumber(n), tonumber(cycles)
+    scimark.benchmarks.FFT(n)(cycles)
+    return string.format('FFT(%d, %d)', n, cycles)
+end
+
+
+
 function measure(name, ...)
     scimark.array_init()
     scimark.rand_init(101009)
diff --git a/talk/iwtc11/benchmarks/scimark.lua b/talk/iwtc11/benchmarks/scimark.lua
--- a/talk/iwtc11/benchmarks/scimark.lua
+++ b/talk/iwtc11/benchmarks/scimark.lua
@@ -37,7 +37,7 @@
 local RANDOM_SEED = 101009 -- Must be odd.
 local SIZE_SELECT = "small"
 
-local benchmarks = {
+benchmarks = {
   "FFT", "SOR", "MC", "SPARSE", "LU",
   small = {
     FFT		= { 1024 },
@@ -213,7 +213,7 @@
 -- SOR: Jacobi Successive Over-Relaxation.
 ------------------------------------------------------------------------------
 
-function sor_run(mat, m, n, cycles, omega)
+local function sor_run(mat, m, n, cycles, omega)
   local om4, om1 = omega*0.25, 1.0-omega
   m = m - 1
   n = n - 1
diff --git a/talk/iwtc11/benchmarks/scimark/kernel.c b/talk/iwtc11/benchmarks/scimark/kernel.c
--- a/talk/iwtc11/benchmarks/scimark/kernel.c
+++ b/talk/iwtc11/benchmarks/scimark/kernel.c
@@ -37,6 +37,7 @@
             cycles *= 2;
 
         }
+        printf("FFT: N=%d, cycles=%d\n", N, cycles);
         /* approx Mflops */
 
         result = FFT_num_flops(N)*cycles/ Stopwatch_read(Q) * 1.0e-6;


More information about the pypy-commit mailing list