diff options
author | Clark Williams <williams@redhat.com> | 2010-02-10 22:40:16 -0600 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2010-02-10 22:40:16 -0600 |
commit | 6956c5757efdf434073428a5d9ff24ee7c55803c (patch) | |
tree | 65f365891574f31a8932bfa5fc8e7b917ca54de3 | |
parent | 73a5259938818e6227fccd326614cde29fcb2306 (diff) | |
download | rteval-6956c5757efdf434073428a5d9ff24ee7c55803c.tar.gz rteval-6956c5757efdf434073428a5d9ff24ee7c55803c.tar.xz rteval-6956c5757efdf434073428a5d9ff24ee7c55803c.zip |
add code to deal with NUMA systems
Modify cyclictest.py to use the new cyclictest options --smp
and --numa, based on the numa nodes listed as available.
Signed-off-by: Clark Williams <williams@redhat.com>
-rw-r--r-- | rteval/cyclictest.py | 19 | ||||
-rw-r--r-- | rteval/rteval.py | 12 | ||||
-rw-r--r-- | rteval/rteval_text.xsl | 4 |
3 files changed, 30 insertions, 5 deletions
diff --git a/rteval/cyclictest.py b/rteval/cyclictest.py index bc18b7d..12ca4e8 100644 --- a/rteval/cyclictest.py +++ b/rteval/cyclictest.py @@ -194,6 +194,12 @@ class Cyclictest(Thread): def debug(self, str): if self.debugging: print "cyclictest: %s" % str + def getmode(self): + from glob import glob + if len(glob('/sys/devices/system/node/node*')) > 1: + return "--numa" + return "--smp" + def run(self): if self.params.has_key('buckets'): buckets = int(self.params.buckets) @@ -202,12 +208,17 @@ class Cyclictest(Thread): if self.params.has_key('interval'): self.interval = '-i%d' % int(self.params.interval) - self.cmd = ['cyclictest', self.interval, '-a', '-qnm', '-d0', '-h %d' % buckets, - "-p%d" % self.priority] + self.cmd = ['cyclictest', + self.interval, + '-qm', + '-d0', + '-h %d' % buckets, + "-p%d" % self.priority, + self.getmode(), + ] + if self.threads: self.cmd.append("-t%d" % self.threads) - else: - self.cmd.append("-t") self.debug("starting with cmd: %s" % " ".join(self.cmd)) null = os.open('/dev/null', os.O_RDWR) diff --git a/rteval/rteval.py b/rteval/rteval.py index 487d288..640b49c 100644 --- a/rteval/rteval.py +++ b/rteval/rteval.py @@ -58,6 +58,8 @@ import rtevalMailer class RtEval(object): def __init__(self, cmdargs): + if os.getuid() != 0: + raise RuntimeError, "must be root to run rteval" self.version = "1.14" self.load_modules = [] self.workdir = os.getcwd() @@ -163,6 +165,12 @@ class RtEval(object): return numcores + def get_num_nodes(self): + from glob import glob + nodes = len(glob('/sys/devices/system/node/node*')) + self.debug("counted %d numa nodes" % nodes) + return nodes + def get_memory_size(self): '''find out how much memory is installed''' f = open('/proc/meminfo') @@ -347,6 +355,7 @@ class RtEval(object): self.xmlreport.openblock('hardware') self.xmlreport.taggedvalue('cpu_cores', self.numcores) + self.xmlreport.taggedvalue('numa_nodes', self.numanodes) self.xmlreport.taggedvalue('memory_size', self.memsize) self.xmlreport.closeblock() @@ -503,6 +512,7 @@ class RtEval(object): # Collect misc system info self.baseos = self.get_base_os() self.numcores = self.get_num_cores() + self.numanodes = self.get_num_nodes() self.memsize = self.get_memory_size() (self.current_clocksource, self.available_clocksource) = self.get_clocksources() self.services = self.get_services() @@ -541,7 +551,7 @@ class RtEval(object): self.start_loads() print "rteval run started at %s" % time.asctime() - print "started %d loads on %d cores" % (len(self.loads), self.numcores) + print "started %d loads on %d cores with %d numa nodes" % (len(self.loads), self.numcores, self.numanodes) print "Run duration: %d seconds" % self.config.duration start = datetime.now() diff --git a/rteval/rteval_text.xsl b/rteval/rteval_text.xsl index d1b6356..74be4b8 100644 --- a/rteval/rteval_text.xsl +++ b/rteval/rteval_text.xsl @@ -44,6 +44,10 @@ <xsl:value-of select="hardware/cpu_cores"/> <xsl:text> </xsl:text> + <xsl:text> NUMA Nodes: </xsl:text> + <xsl:value-of select="hardware/numa_nodes"/> + <xsl:text> </xsl:text> + <xsl:text> Memory: </xsl:text> <xsl:value-of select="hardware/memory_size"/> <xsl:text> KB </xsl:text> |