diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-02-21 18:32:24 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-02-21 18:32:24 -0500 |
commit | 6e2b99a0870e467e35c8b4b95aeb1e665dded413 (patch) | |
tree | 1e4b4d000c6b53b93a35b5446dc774d4799c987c /run/experiment.py | |
parent | 9bcbb4048cd82ea11ed469731eae95d808b99449 (diff) |
Many bugfixes motivated by some end-to-end testing.
Diffstat (limited to 'run/experiment.py')
-rw-r--r-- | run/experiment.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/run/experiment.py b/run/experiment.py index c8fc228..ecb0241 100644 --- a/run/experiment.py +++ b/run/experiment.py | |||
@@ -1,8 +1,9 @@ | |||
1 | import os | 1 | import os |
2 | import time | 2 | import time |
3 | import litmus_util as lu | 3 | import run.litmus_util as lu |
4 | import shutil as sh | ||
4 | from operator import methodcaller | 5 | from operator import methodcaller |
5 | from tracer import SchedTracer, LogTracer, PerfTracer, LinuxTracer, OverheadTracer | 6 | from run.tracer import SchedTracer, LogTracer, PerfTracer, LinuxTracer, OverheadTracer |
6 | 7 | ||
7 | class ExperimentException(Exception): | 8 | class ExperimentException(Exception): |
8 | '''Used to indicate when there are problems with an experiment.''' | 9 | '''Used to indicate when there are problems with an experiment.''' |
@@ -78,6 +79,8 @@ class Experiment(object): | |||
78 | Experiment.INTERRUPTED_DIR) | 79 | Experiment.INTERRUPTED_DIR) |
79 | interrupted = "%s/%s" % (os.path.split(self.working_dir)[0], | 80 | interrupted = "%s/%s" % (os.path.split(self.working_dir)[0], |
80 | Experiment.INTERRUPTED_DIR) | 81 | Experiment.INTERRUPTED_DIR) |
82 | if os.path.exists(interrupted): | ||
83 | sh.rmtree(interrupted) | ||
81 | os.rename(self.working_dir, interrupted) | 84 | os.rename(self.working_dir, interrupted) |
82 | 85 | ||
83 | os.mkdir(self.working_dir) | 86 | os.mkdir(self.working_dir) |
@@ -154,7 +157,7 @@ class Experiment(object): | |||
154 | os.rename(self.working_dir, self.finished_dir) | 157 | os.rename(self.working_dir, self.finished_dir) |
155 | 158 | ||
156 | def log(self, msg): | 159 | def log(self, msg): |
157 | print "[Exp %s]: %s" % (self.name, msg) | 160 | print("[Exp %s]: %s" % (self.name, msg)) |
158 | 161 | ||
159 | def run_exp(self): | 162 | def run_exp(self): |
160 | succ = False | 163 | succ = False |