diff options
Diffstat (limited to 'run_exps.py')
| -rwxr-xr-x | run_exps.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/run_exps.py b/run_exps.py index c589f51..bc15b98 100755 --- a/run_exps.py +++ b/run_exps.py | |||
| @@ -55,8 +55,8 @@ def convert_data(data): | |||
| 55 | else: | 55 | else: |
| 56 | prog = match.group("TYPE") or "rtspin" | 56 | prog = match.group("TYPE") or "rtspin" |
| 57 | spin = (prog, match.group("ARGS")) | 57 | spin = (prog, match.group("ARGS")) |
| 58 | spins.append(spin) | 58 | spins.append(spin) |
| 59 | 59 | ||
| 60 | return {'proc' : procs, 'spin' : spins} | 60 | return {'proc' : procs, 'spin' : spins} |
| 61 | 61 | ||
| 62 | 62 | ||
| @@ -80,7 +80,7 @@ def load_experiment(sched_file, scheduler, duration, param_file, out_base): | |||
| 80 | raise IOError("Cannot find schedule file: %s" % sched_file) | 80 | raise IOError("Cannot find schedule file: %s" % sched_file) |
| 81 | 81 | ||
| 82 | dirname = os.path.split(sched_file)[0] | 82 | dirname = os.path.split(sched_file)[0] |
| 83 | 83 | ||
| 84 | if not scheduler or not duration: | 84 | if not scheduler or not duration: |
| 85 | param_file = param_file or \ | 85 | param_file = param_file or \ |
| 86 | "%s/%s" % (dirname, conf.DEFAULTS['params_file']) | 86 | "%s/%s" % (dirname, conf.DEFAULTS['params_file']) |
| @@ -89,7 +89,7 @@ def load_experiment(sched_file, scheduler, duration, param_file, out_base): | |||
| 89 | params = load_params(param_file) | 89 | params = load_params(param_file) |
| 90 | scheduler = scheduler or params[conf.PARAMS['sched']] | 90 | scheduler = scheduler or params[conf.PARAMS['sched']] |
| 91 | duration = duration or params[conf.PARAMS['dur']] | 91 | duration = duration or params[conf.PARAMS['dur']] |
| 92 | 92 | ||
| 93 | duration = duration or conf.DEFAULTS['duration'] | 93 | duration = duration or conf.DEFAULTS['duration'] |
| 94 | 94 | ||
| 95 | if not scheduler: | 95 | if not scheduler: |
| @@ -133,10 +133,10 @@ def run_exp(name, schedule, scheduler, duration, work_dir, out_dir): | |||
| 133 | for entry_conf in schedule['proc']: | 133 | for entry_conf in schedule['proc']: |
| 134 | path = entry_conf[0] | 134 | path = entry_conf[0] |
| 135 | data = entry_conf[1] | 135 | data = entry_conf[1] |
| 136 | 136 | ||
| 137 | if not os.path.exists(path): | 137 | if not os.path.exists(path): |
| 138 | raise IOError("Invalid proc path %s: %s" % (path, name)) | 138 | raise IOError("Invalid proc path %s: %s" % (path, name)) |
| 139 | 139 | ||
| 140 | proc_entries += [ProcEntry(path, data)] | 140 | proc_entries += [ProcEntry(path, data)] |
| 141 | 141 | ||
| 142 | # Parse spinners | 142 | # Parse spinners |
| @@ -158,14 +158,14 @@ def run_exp(name, schedule, scheduler, duration, work_dir, out_dir): | |||
| 158 | 158 | ||
| 159 | if not lu.is_executable(real_spin): | 159 | if not lu.is_executable(real_spin): |
| 160 | raise OSError("Cannot run spin %s: %s" % (real_spin, name)) | 160 | raise OSError("Cannot run spin %s: %s" % (real_spin, name)) |
| 161 | 161 | ||
| 162 | executables += [Executable(real_spin, real_args)] | 162 | executables += [Executable(real_spin, real_args)] |
| 163 | 163 | ||
| 164 | exp = Experiment(name, scheduler, work_dir, out_dir, | 164 | exp = Experiment(name, scheduler, work_dir, out_dir, |
| 165 | proc_entries, executables) | 165 | proc_entries, executables) |
| 166 | exp.run_exp() | 166 | exp.run_exp() |
| 167 | 167 | ||
| 168 | 168 | ||
| 169 | def main(): | 169 | def main(): |
| 170 | opts, args = parse_args() | 170 | opts, args = parse_args() |
| 171 | 171 | ||
| @@ -181,12 +181,12 @@ def main(): | |||
| 181 | 181 | ||
| 182 | if not os.path.exists(path): | 182 | if not os.path.exists(path): |
| 183 | raise IOError("Invalid experiment: %s" % path) | 183 | raise IOError("Invalid experiment: %s" % path) |
| 184 | 184 | ||
| 185 | if os.path.isdir(exp): | 185 | if os.path.isdir(exp): |
| 186 | path = "%s%s" % (path, opts.sched_file) | 186 | path = "%s%s" % (path, opts.sched_file) |
| 187 | 187 | ||
| 188 | load_experiment(path, scheduler, duration, param_file, out_base) | 188 | load_experiment(path, scheduler, duration, param_file, out_base) |
| 189 | 189 | ||
| 190 | 190 | ||
| 191 | if __name__ == '__main__': | 191 | if __name__ == '__main__': |
| 192 | main() | 192 | main() |
