diff options
author | Clark Williams <williams@redhat.com> | 2015-06-08 16:49:36 -0500 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2015-06-08 16:49:36 -0500 |
commit | 2bc5c0963cbee36ed303415dbef9f55084364b30 (patch) | |
tree | 1b559065595df690a9586c5e2bc0f6cab5920fba | |
parent | 8bc8044056df2e017b0d38968657c380abfd9821 (diff) | |
download | rteval-2bc5c0963cbee36ed303415dbef9f55084364b30.tar.gz |
loads: added ability to place load threads on specific cpu range
Use the input cpulist from --loads-cpulist to place the kcompile
and hackbench loads on specific cpu ranges with the 'taskset'
utility.
Signed-off-by: Clark Williams <williams@redhat.com>
-rw-r--r-- | rteval/modules/loads/hackbench.py | 12 | ||||
-rw-r--r-- | rteval/modules/loads/kcompile.py | 12 |
2 files changed, 22 insertions, 2 deletions
diff --git a/rteval/modules/loads/hackbench.py b/rteval/modules/loads/hackbench.py index e0629e1..4b896d1 100644 --- a/rteval/modules/loads/hackbench.py +++ b/rteval/modules/loads/hackbench.py @@ -29,7 +29,7 @@ import sys, os, time, glob, subprocess, errno from signal import SIGKILL from rteval.modules.loads import CommandLineLoad from rteval.Log import Log - +from rteval.misc import expand_cpulist class Hackbench(CommandLineLoad): def __init__(self, config, logger): @@ -53,13 +53,21 @@ class Hackbench(CommandLineLoad): mult = 0 self._donotrun = True - self.jobs = self.num_cpus * mult + if self._cfg.has_key('cpulist'): + cpulist = self._cfg.cpulist + self.jobs = len(expand_cpulist(cpulist)) * mult + else: + cpulist = None + self.jobs = self.num_cpus * mult self.args = ['hackbench', '-P', '-g', str(self.jobs), '-l', str(self._cfg.setdefault('loops', '100')), '-s', str(self._cfg.setdefault('datasize', '100')) ] + if cpulist: + self.args = ['taskset', '-c', cpulist ] + self.args + self.__err_sleep = 5.0 diff --git a/rteval/modules/loads/kcompile.py b/rteval/modules/loads/kcompile.py index 31a637a..3ac0d53 100644 --- a/rteval/modules/loads/kcompile.py +++ b/rteval/modules/loads/kcompile.py @@ -28,6 +28,7 @@ from signal import SIGTERM from rteval.modules import rtevalRuntimeError from rteval.modules.loads import CommandLineLoad from rteval.Log import Log +from rteval.misc import expand_cpulist kernel_prefix="linux-2.6" @@ -136,10 +137,21 @@ class Kcompile(CommandLineLoad): else: self.__outfd = self.__errfd = self.__nullfd + if self._cfg.has_key('cpulist'): + cpulist = self._cfg.cpulist + self.num_cpus = len(expand_cpulist(cpulist)) + else: + cpulist = None + self.jobs = self.__calc_numjobs() self._log(Log.DEBUG, "starting loop (jobs: %d)" % self.jobs) + self.args = ["make", "-C", self.mydir, "-j%d" % self.jobs ] + + if cpulist: + self.args = ["taskset", '-c', cpulist] + self.args + self.__kcompileproc = None |