aboutsummaryrefslogtreecommitdiffstats
path: root/common.py
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-05-01 15:48:01 -0400
committerJonathan Herman <hermanjl@cs.unc.edu>2013-05-01 15:48:01 -0400
commitcd9f1b026cc5c4526dfbd2f7b1c5f39edb6a7309 (patch)
tree5b6221e55d7f50c88a574ed4f57ff7efd9b7103d /common.py
parent94cc65997d237ddeab24d396f06bb93bc0644a9d (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 'common.py')
-rw-r--r--common.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/common.py b/common.py
index 7abf0f2..9ea2915 100644
--- a/common.py
+++ b/common.py
@@ -182,7 +182,7 @@ def ft_freq():
182 182
183 183
184def kernel(): 184def kernel():
185 return subprocess.check_output(["uname", "-r"]) 185 return subprocess.check_output(["uname", "-r"]).strip("\n")
186 186
187def is_executable(fname): 187def is_executable(fname):
188 '''Return whether the file passed in is executable''' 188 '''Return whether the file passed in is executable'''
@@ -210,3 +210,6 @@ def log_once(id, msg = None, indent = True):
210 if indent: 210 if indent:
211 msg = ' ' + msg.strip('\t').replace('\n', '\n\t') 211 msg = ' ' + msg.strip('\t').replace('\n', '\n\t')
212 sys.stderr.write('\n' + msg.strip('\n') + '\n') 212 sys.stderr.write('\n' + msg.strip('\n') + '\n')
213
214def get_cmd():
215 return os.path.split(sys.argv[0])[1]