diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-02-17 15:02:15 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-02-17 15:02:15 -0500 |
commit | 649b64013619f67160fd289b208189b88e6196fa (patch) | |
tree | 4198c160a8ff83f0976e8e125c0d796db19985fb /run_exps.py | |
parent | ea121dd26076998ffdc89792f62da5d585a1f35c (diff) |
Save feather-trace timer frequency, not CPU frequency, with each experiment.
Diffstat (limited to 'run_exps.py')
-rwxr-xr-x | run_exps.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/run_exps.py b/run_exps.py index 8fd9ed2..d1e0026 100755 --- a/run_exps.py +++ b/run_exps.py | |||
@@ -14,9 +14,13 @@ from run.executable.executable import Executable | |||
14 | from run.experiment import Experiment,ExperimentDone | 14 | from run.experiment import Experiment,ExperimentDone |
15 | from run.proc_entry import ProcEntry | 15 | from run.proc_entry import ProcEntry |
16 | 16 | ||
17 | def InvalidKernel(Exception): | 17 | class InvalidKernel(Exception): |
18 | def __init__(self, kernel): | 18 | def __init__(self, kernel, wanted): |
19 | self.kernel = kernel | 19 | self.kernel = kernel |
20 | self.wanted = wanted | ||
21 | |||
22 | def __str__(self): | ||
23 | return "Kernel '%s' does not match '%s'." % (self.kernel, self.wanted) | ||
20 | 24 | ||
21 | def parse_args(): | 25 | def parse_args(): |
22 | parser = OptionParser("usage: %prog [options] [sched_file]... [exp_dir]...") | 26 | parser = OptionParser("usage: %prog [options] [sched_file]... [exp_dir]...") |
@@ -114,12 +118,16 @@ def load_experiment(sched_file, scheduler, duration, param_file, out_dir): | |||
114 | run_exp(sched_file, schedule, scheduler, kernel, duration, work_dir, out_dir) | 118 | run_exp(sched_file, schedule, scheduler, kernel, duration, work_dir, out_dir) |
115 | 119 | ||
116 | # Save parameters used to run experiment in out_dir | 120 | # Save parameters used to run experiment in out_dir |
117 | # Cycles is saved here for accurate overhead calculations later | ||
118 | out_params = dict(params.items() + | 121 | out_params = dict(params.items() + |
119 | [(conf.PARAMS['sched'], scheduler), | 122 | [(conf.PARAMS['sched'], scheduler), |
120 | (conf.PARAMS['tasks'], len(schedule['spin'])), | 123 | (conf.PARAMS['tasks'], len(schedule['spin'])), |
121 | (conf.PARAMS['dur'], duration), | 124 | (conf.PARAMS['dur'], duration)]) |
122 | (conf.PARAMS['cycles'], lu.cpu_freq())]) | 125 | |
126 | # Feather-trace clock frequency saved for accurate overhead parsing | ||
127 | ft_freq = lu.ft_freq() | ||
128 | if ft_freq: | ||
129 | out_params[conf.PARAMS['cycles']] = ft_freq | ||
130 | |||
123 | with open("%s/%s" % (out_dir, conf.DEFAULTS['params_file']), 'w') as f: | 131 | with open("%s/%s" % (out_dir, conf.DEFAULTS['params_file']), 'w') as f: |
124 | f.write(str(out_params)) | 132 | f.write(str(out_params)) |
125 | 133 | ||