Author: Remi Meier <[email protected]>
Branch: multithread-runner
Changeset: r354:ea22d0e33d51
Date: 2016-05-27 13:00 +0200
http://bitbucket.org/pypy/benchmarks/changeset/ea22d0e33d51/
Log: progress
diff --git a/multithread/common/abstract_threading.py
b/multithread/common/abstract_threading.py
--- a/multithread/common/abstract_threading.py
+++ b/multithread/common/abstract_threading.py
@@ -15,6 +15,16 @@
def print_abort_info(tm=0.0):
"backward compatibility: no-op"
+def turn_jitting_off():
+ """function that turns off the JIT
+ shouldn't be in this module, but well..."""
+ try:
+ import pypyjit
+ pypyjit.set_param("off")
+ pypyjit.set_param("threshold=999999999,trace_eagerness=99999999")
+ except ImportError:
+ pass
+
class TLQueue_concurrent(object):
def __init__(self):
@@ -144,9 +154,9 @@
def _task(self, func, *args, **kwargs):
with self._cond:
try:
- #hint_commit_soon()
+ hint_commit_soon()
self._result = func(*args, **kwargs)
- #hint_commit_soon()
+ hint_commit_soon()
except Exception as e:
self._exception = e
finally:
@@ -173,10 +183,10 @@
def _task(self, func, *args, **kwargs):
with self._cond:
try:
- #hint_commit_soon()
+ hint_commit_soon()
with atomic:
self._result = func(*args, **kwargs)
- #hint_commit_soon()
+ hint_commit_soon()
except Exception as e:
self._exception = e
finally:
diff --git a/multithread/config-raytrace.json b/multithread/config-raytrace.json
--- a/multithread/config-raytrace.json
+++ b/multithread/config-raytrace.json
@@ -14,8 +14,8 @@
"file": "raytrace/raytrace.py",
"PYTHONPATH": "..",
"vmstarts": 5,
- "warmiters": 3,
- "args": ["512", "4096"]
+ "warmiters": 2,
+ "args": ["128", "512"]
}
}
}
diff --git a/multithread/raytrace/raytrace.py b/multithread/raytrace/raytrace.py
--- a/multithread/raytrace/raytrace.py
+++ b/multithread/raytrace/raytrace.py
@@ -4,7 +4,7 @@
from math import sqrt, pi
from common.abstract_threading import (
atomic, Future, set_thread_pool, ThreadPool,
- print_abort_info, hint_commit_soon)
+ print_abort_info, hint_commit_soon, turn_jitting_off)
import time
#import platform
@@ -138,7 +138,7 @@
def task(line, x, h, cameraPos, objs, lightSource):
for y in range(h):
- with atomic:
+ if 1:#with atomic:
ray = Ray(cameraPos,
(Vector(x/50.0-5,y/50.0-5,0)-cameraPos).normal())
col = trace(ray, objs, lightSource, 10)
@@ -193,13 +193,12 @@
print "params (iters, threads, w, h):", warmiters, threads, w, h
print "do warmup:"
- for i in range(5):
+ for i in range(3):
print "iter", i, "time:", run(threads, w, h)
- print "turn off jit"
- import pypyjit, gc
- pypyjit.set_param("off")
- pypyjit.set_param("threshold=999999999,trace_eagerness=99999999")
+ print "turn off jitting"
+ import gc
+ turn_jitting_off()
print "do", warmiters, "real iters:"
times = []
for i in range(warmiters):
diff --git a/multithread/runner.py b/multithread/runner.py
--- a/multithread/runner.py
+++ b/multithread/runner.py
@@ -81,9 +81,9 @@
except Exception as e:
failures.append({
'cmd': cmd_str, 'exception': str(e)})
- except KeyboardInterrupt as e:
+ except KeyboardInterrupt:
failures.append({
- 'cmd': cmd_str, 'exception': str(e)})
+ 'cmd': cmd_str, 'exception': 'KeyboardInterrupt'})
return failures, timings
return failures, timings
@@ -128,9 +128,24 @@
else:
results = {}
+ p = Popen([python_exec, "--version"],
+ stdout=PIPE, stderr=PIPE)
+ _, python_version = p.communicate()
+ assert p.returncode == 0
+ print python_version
+
+ p = Popen(["hg", "id"], stdout=PIPE, stderr=PIPE)
+ hg_id, _ = p.communicate()
+ assert p.returncode == 0
+ print "id", hg_id
+
run_key = time.ctime()
- results[run_key] = {'config': config,
- 'python': python_exec}
+ results[run_key] = {
+ 'config': config,
+ 'python': python_exec,
+ 'python-version': python_version,
+ 'hg-id': hg_id}
+
try:
run_benchmarks(results[run_key])
print results[run_key]['results']
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit