diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2019-03-06 13:30:00 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2019-03-06 13:30:00 +0100 |
| commit | 8fde3923932fa55979661572b82ffd25b1c33f87 (patch) | |
| tree | ac4545385d72b43af41d518817af213b6486f0f6 | |
| parent | 0623a281998ee1d7a62c3f904f76888446cb237a (diff) | |
| download | allocbench-8fde3923932fa55979661572b82ffd25b1c33f87.tar.gz allocbench-8fde3923932fa55979661572b82ffd25b1c33f87.zip | |
improve thread scaling
| -rw-r--r-- | src/benchmark.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/benchmark.py b/src/benchmark.py index 7d3207f..edf5b16 100644 --- a/src/benchmark.py +++ b/src/benchmark.py @@ -28,16 +28,17 @@ class Benchmark (object): } @staticmethod - def scale_threads_for_cpus(factor): + def scale_threads_for_cpus(factor, steps=None): cpus = multiprocessing.cpu_count() max_threads = cpus * factor - steps = 1 - if max_threads > 40: - steps = 2 - if max_threads > 100: - steps = 5 - if max_threads > 200: - steps = 10 + if not steps: + steps = 1 + if max_threads >= 20 and max_threads < 50: + steps = 2 + if max_threads >= 50 max_threads < 100: + steps = 5 + if max_threads >= 100: + steps = 10 # Special thread counts nthreads = set([1, int(cpus/2), cpus, cpus*factor]) |
