|
3 | 3 | def cli(): |
4 | 4 | import os,sys,argparse |
5 | 5 | cli = argparse.ArgumentParser(description='CLARA scaling test') |
6 | | - cli.add_argument('-P',help='plot only',action='store_true') |
7 | | - cli.add_argument('-y',help='YAML file',default=None) |
| 6 | + cli.add_argument('-y',help='YAML file',required=True) |
8 | 7 | cli.add_argument('-c',help='CLARA_HOME path',default=os.getenv('CLARA_HOME',None)) |
9 | 8 | cli.add_argument('-t',help='threads (default=4,8)',default='4,8') |
10 | 9 | cli.add_argument('-e',help='events per thread',default=100,type=int) |
11 | | - cli.add_argument('-i',help='input data file',default=None) |
| 10 | + cli.add_argument('-i',help='input data file',required=True) |
12 | 11 | cfg = cli.parse_args() |
13 | 12 | cfg.t = cfg.t.split(',') |
14 | | - if cfg.P: |
15 | | - cfg.i = 'scaling.txt' |
16 | | - else: |
17 | | - if cfg.y is None: sys.exit('-y YAML is required w/o -P') |
18 | | - if cfg.c is None: sys.exit('-c or $CLARA_HOME is required w/o -P') |
19 | | - if cfg.i is None: sys.exit('-i is required') |
| 13 | + if cfg.c is None: sys.exit('-c or $CLARA_HOME is required.') |
20 | 14 | return cfg |
21 | 15 |
|
22 | 16 | def run(cmd): |
@@ -106,10 +100,9 @@ def save(benchmarks): |
106 | 100 |
|
107 | 101 | if __name__ == '__main__': |
108 | 102 | cfg = cli() |
109 | | - if not cfg.P: |
110 | | - benchmarks = [] |
111 | | - for threads in cfg.t: |
112 | | - benchmarks.append([threads, benchmark(cfg, threads)]) |
113 | | - show(benchmarks) |
114 | | - save(benchmarks) |
| 103 | + benchmarks = [] |
| 104 | + for threads in cfg.t: |
| 105 | + benchmarks.append([threads, benchmark(cfg, threads)]) |
| 106 | + show(benchmarks) |
| 107 | + save(benchmarks) |
115 | 108 |
|
0 commit comments