diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-05-01 15:48:01 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-05-01 15:48:01 -0400 |
commit | cd9f1b026cc5c4526dfbd2f7b1c5f39edb6a7309 (patch) | |
tree | 5b6221e55d7f50c88a574ed4f57ff7efd9b7103d /run/experiment.py | |
parent | 94cc65997d237ddeab24d396f06bb93bc0644a9d (diff) |
Added --crontab option to run_exps.py
This will use crontab to automatically restart the machine and resume
the script when the machine crashes. An additional option, -k, is provided
to cancel this operation.
Diffstat (limited to 'run/experiment.py')
-rw-r--r-- | run/experiment.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/run/experiment.py b/run/experiment.py index 9a70414..da0e32e 100644 --- a/run/experiment.py +++ b/run/experiment.py | |||
@@ -35,6 +35,9 @@ class Experiment(object): | |||
35 | self.exec_err = None | 35 | self.exec_err = None |
36 | self.tracer_types = tracer_types | 36 | self.tracer_types = tracer_types |
37 | 37 | ||
38 | self.regular_tracers = [] | ||
39 | self.exact_tracers = [] | ||
40 | |||
38 | def __setup_tracers(self): | 41 | def __setup_tracers(self): |
39 | tracers = [ t(self.working_dir) for t in self.tracer_types ] | 42 | tracers = [ t(self.working_dir) for t in self.tracer_types ] |
40 | 43 | ||
@@ -55,8 +58,13 @@ class Experiment(object): | |||
55 | Experiment.INTERRUPTED_DIR) | 58 | Experiment.INTERRUPTED_DIR) |
56 | interrupted = "%s/%s" % (os.path.split(self.working_dir)[0], | 59 | interrupted = "%s/%s" % (os.path.split(self.working_dir)[0], |
57 | Experiment.INTERRUPTED_DIR) | 60 | Experiment.INTERRUPTED_DIR) |
61 | old_int = "%s/%s" % (self.working_dir, Experiment.INTERRUPTED_DIR) | ||
62 | |||
58 | if os.path.exists(interrupted): | 63 | if os.path.exists(interrupted): |
59 | sh.rmtree(interrupted) | 64 | sh.rmtree(interrupted) |
65 | if os.path.exists(old_int): | ||
66 | sh.rmtree(old_int) | ||
67 | |||
60 | os.rename(self.working_dir, interrupted) | 68 | os.rename(self.working_dir, interrupted) |
61 | 69 | ||
62 | os.mkdir(self.working_dir) | 70 | os.mkdir(self.working_dir) |