diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-04-29 16:50:23 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-04-29 16:50:23 -0400 |
commit | 7e32c3915e7ea27d2533d99a22fa53ef923198f5 (patch) | |
tree | 5bd8d8a3ed6861e039a683f47a953d2f7a22d8b1 /gen_exps.py | |
parent | 7545402506aa76261e18d85af585ff0ac1cf05c1 (diff) |
Added run_exps.py option to --retry failed experiments.
If the retry flag is specified, failed experiments will be re-run after all
other experiments have run. They can be re-run at most 5 times.
This commit required a refactoring of run_exps.py to clean up the main
experiment running loop.
Diffstat (limited to 'gen_exps.py')
-rwxr-xr-x | gen_exps.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/gen_exps.py b/gen_exps.py index b847661..00ce27b 100755 --- a/gen_exps.py +++ b/gen_exps.py | |||
@@ -43,6 +43,14 @@ def load_file(fname): | |||
43 | except: | 43 | except: |
44 | raise IOError("Invalid generation file: %s" % fname) | 44 | raise IOError("Invalid generation file: %s" % fname) |
45 | 45 | ||
46 | def print_descriptions(described): | ||
47 | for generator in described.split(','): | ||
48 | if generator not in gen.get_generators(): | ||
49 | sys.stderr.write("No generator '%s'\n" % generator) | ||
50 | else: | ||
51 | print("Generator '%s', " % generator) | ||
52 | gen.get_generators()[generator]().print_help() | ||
53 | |||
46 | def main(): | 54 | def main(): |
47 | opts, args = parse_args() | 55 | opts, args = parse_args() |
48 | 56 | ||
@@ -50,12 +58,7 @@ def main(): | |||
50 | if opts.list_gens: | 58 | if opts.list_gens: |
51 | print(", ".join(gen.get_generators())) | 59 | print(", ".join(gen.get_generators())) |
52 | if opts.described != None: | 60 | if opts.described != None: |
53 | for generator in opts.described.split(','): | 61 | print_descriptions(opts.described) |
54 | if generator not in gen.get_generators(): | ||
55 | sys.stderr.write("No generator '%s'\n" % generator) | ||
56 | else: | ||
57 | print("Generator '%s', " % generator) | ||
58 | gen.get_generators()[generator]().print_help() | ||
59 | if opts.list_gens or opts.described: | 62 | if opts.list_gens or opts.described: |
60 | return 0 | 63 | return 0 |
61 | 64 | ||