[pypy-commit] extradoc extradoc: trying out SOR benchmark

hakanardo noreply at buildbot.pypy.org
Fri Aug 10 21:00:39 CEST 2012


Author: Hakan Ardo <hakan at debian.org>
Branch: extradoc
Changeset: r4509:71fe567bb62f
Date: 2012-08-10 21:00 +0200
http://bitbucket.org/pypy/extradoc/changeset/71fe567bb62f/

Log:	trying out SOR benchmark

diff --git a/talk/iwtc11/benchmarks/scimark.py b/talk/iwtc11/benchmarks/scimark.py
new file mode 100644
--- /dev/null
+++ b/talk/iwtc11/benchmarks/scimark.py
@@ -0,0 +1,21 @@
+from convolution.convolution import Array2D
+
+def SOR_execute(omega, G, num_iterations):
+    for p in xrange(num_iterations):
+        for i in xrange(1, G.height - 1):
+            for j in xrange(1, G.width - 1):
+                G[j, i] = omega * 0.25 * (G[j, i-1] + G[j, i+1] + G[j-1, i] +
+                                          G[j+1, i] + (1.0 - omega) * G[j, i])
+def SOR(args):
+    n, cycles = map(int, args)
+    a = Array2D(n, n)
+    SOR_execute(1.25, a, cycles)
+
+if __name__ == '__main__':
+    from time import time
+    for i in range(10):
+        t0 = time()
+        #SOR([100, 32768]) # gcc -O3: 2.51, pypy-1.8: 3.83
+        SOR([1000, 256]) # gcc -O3 2.07, pypy-1.8: 3.03
+        t1 = time()
+        print t1-t0


More information about the pypy-commit mailing list