summaryrefslogtreecommitdiffstats
path: root/rteval/modules/loads
diff options
context:
space:
mode:
authorDavid Sommerseth <davids@redhat.com>2013-01-15 21:12:55 +0100
committerDavid Sommerseth <davids@redhat.com>2013-01-15 21:12:55 +0100
commit6c0f7ab28d73fa7703b8374355a1563b5c97eba2 (patch)
treed7d18cbe5e5e55e520455f038b07fc894485f537 /rteval/modules/loads
parentbe08f7cb83dce2256e2e62fe54e25a32794052a0 (diff)
downloadrteval-6c0f7ab28d73fa7703b8374355a1563b5c97eba2.tar.gz
rteval-6c0f7ab28d73fa7703b8374355a1563b5c97eba2.tar.xz
rteval-6c0f7ab28d73fa7703b8374355a1563b5c97eba2.zip
Reworked the run logic for modules - allow them to flag they won't run
If a module sets the self._donotrun flag to True, the module logic will take care of not running this module at all. This also sorts out some issues when hackbench is not run, where some of the log file descriptors are not found when cleaning up in the end. Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'rteval/modules/loads')
-rw-r--r--rteval/modules/loads/__init__.py2
-rw-r--r--rteval/modules/loads/hackbench.py10
2 files changed, 6 insertions, 6 deletions
diff --git a/rteval/modules/loads/__init__.py b/rteval/modules/loads/__init__.py
index ca84f47..69de0a8 100644
--- a/rteval/modules/loads/__init__.py
+++ b/rteval/modules/loads/__init__.py
@@ -70,7 +70,7 @@ class CommandLineLoad(LoadThread):
def MakeReport(self):
- if not (self.jobs and self.args):
+ if not (self.jobs and self.args) or self._donotrun:
return None
rep_n = libxml2.newNode("command_line")
diff --git a/rteval/modules/loads/hackbench.py b/rteval/modules/loads/hackbench.py
index 6cb0524..53c4739 100644
--- a/rteval/modules/loads/hackbench.py
+++ b/rteval/modules/loads/hackbench.py
@@ -51,6 +51,8 @@ class Hackbench(CommandLineLoad):
else:
self._log(Log.INFO, "hackbench: low memory system (%f GB/core)! Not running\n" % ratio)
mult = 0
+ self._donotrun = True
+
self.jobs = self.num_cpus * mult
self.args = ['hackbench', '-P',
@@ -67,11 +69,6 @@ class Hackbench(CommandLineLoad):
def _WorkloadPrepare(self):
- # if we don't have any jobs just wait for the stop event and return
- if self.jobs == 0:
- self.WaitForCompletion()
- return
-
self.__nullfp = os.open("/dev/null", os.O_RDWR)
if self._logging:
self.__out = self.open_logfile("hackbench.stdout")
@@ -111,6 +108,9 @@ class Hackbench(CommandLineLoad):
def _WorkloadCleanup(self):
+ if self._donotrun:
+ return
+
if self.__hbproc.poll() == None:
os.kill(self.__hbproc.pid, SIGKILL)
self.__hbproc.wait()