diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-02-07 11:21:23 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-02-07 11:21:23 -0500 |
commit | 39020cf5ae3030bc15035925a0c72eb44eea67b7 (patch) | |
tree | fb82b339c1e5c14334f8d9839f8d836b120fbb08 /parse_exps.py | |
parent | d524da9bd072ad1be4ac0d633e3e783094ddc2d7 (diff) |
Added gen_exps.py script.
Diffstat (limited to 'parse_exps.py')
-rwxr-xr-x | parse_exps.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/parse_exps.py b/parse_exps.py index c8cd8b1..f7e1342 100755 --- a/parse_exps.py +++ b/parse_exps.py | |||
@@ -18,6 +18,8 @@ def parse_args(): | |||
18 | # TODO: convert data-dir to proper option, clean 'dest' options | 18 | # TODO: convert data-dir to proper option, clean 'dest' options |
19 | parser = OptionParser("usage: %prog [options] [data_dir]...") | 19 | parser = OptionParser("usage: %prog [options] [data_dir]...") |
20 | 20 | ||
21 | print("default to no params.py") | ||
22 | |||
21 | parser.add_option('-o', '--out', dest='out', | 23 | parser.add_option('-o', '--out', dest='out', |
22 | help='file or directory for data output', default='parse-data') | 24 | help='file or directory for data output', default='parse-data') |
23 | parser.add_option('-c', '--clean', action='store_true', default=False, | 25 | parser.add_option('-c', '--clean', action='store_true', default=False, |
@@ -41,19 +43,14 @@ def get_exp_params(data_dir, col_map): | |||
41 | if not os.path.isfile: | 43 | if not os.path.isfile: |
42 | raise Exception("No param file '%s' exists!" % param_file) | 44 | raise Exception("No param file '%s' exists!" % param_file) |
43 | 45 | ||
44 | # Ignore 'magic' parameters used by these scripts | ||
45 | params = load_params(param_file) | 46 | params = load_params(param_file) |
46 | for ignored in conf.PARAMS.itervalues(): | ||
47 | # With the exception of cycles which is used by overhead parsing | ||
48 | if ignored in params and ignored != conf.PARAMS['cycles']: | ||
49 | params.pop(ignored) | ||
50 | 47 | ||
51 | # Store parameters in col_map, which will track which parameters change | 48 | # Store parameters in col_map, which will track which parameters change |
52 | # across experiments | 49 | # across experiments |
53 | for key, value in params.iteritems(): | 50 | for key, value in params.iteritems(): |
54 | col_map.try_add(key, value) | 51 | col_map.try_add(key, value) |
55 | 52 | ||
56 | # Cycles must be present | 53 | # Cycles must be present for feather-trace measurement parsing |
57 | if conf.PARAMS['cycles'] not in params: | 54 | if conf.PARAMS['cycles'] not in params: |
58 | params[conf.PARAMS['cycles']] = conf.DEFAULTS['cycles'] | 55 | params[conf.PARAMS['cycles']] = conf.DEFAULTS['cycles'] |
59 | 56 | ||
@@ -72,10 +69,10 @@ def load_exps(exp_dirs, col_map, clean): | |||
72 | # Used to store error output and debugging info | 69 | # Used to store error output and debugging info |
73 | work_dir = data_dir + "/tmp" | 70 | work_dir = data_dir + "/tmp" |
74 | 71 | ||
72 | if os.path.exists(work_dir) and clean: | ||
73 | sh.rmtree(work_dir) | ||
75 | if not os.path.exists(work_dir): | 74 | if not os.path.exists(work_dir): |
76 | os.mkdir(work_dir) | 75 | os.mkdir(work_dir) |
77 | elif clean: | ||
78 | sh.rmtree(work_dir) | ||
79 | 76 | ||
80 | params = get_exp_params(data_dir, col_map) | 77 | params = get_exp_params(data_dir, col_map) |
81 | 78 | ||