From 3bdb29dce96cf023532b086768b23a434d62f156 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 27 Feb 2019 15:02:54 +0100 Subject: scale loop runs with number of cpus --- src/loop.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/loop.py b/src/loop.py index 7e23cd7..1f84959 100644 --- a/src/loop.py +++ b/src/loop.py @@ -11,10 +11,15 @@ class Benchmark_Loop(Benchmark): self.cmd = "loop{binary_suffix} {nthreads} 1000000 {maxsize}" - self.args = { - "maxsize": [2 ** x for x in range(6, 16)], - "nthreads": range(1, multiprocessing.cpu_count() * 2 + 1) - } + cpus = multiprocessing.cpu_count() + steps = 1 + if cpus > 20: + steps = 2 + if cpus > 50: + steps = 5 + + self.args = {"maxsize": [2 ** x for x in range(6, 16)], + "nthreads": range(1, multiprocessing.cpu_count() * 2 + 1, steps)} self.requirements = ["loop"] super().__init__() -- cgit v1.2.3