- Timestamp:
- Nov 11, 2020, 12:22:20 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 2c2b60f
- Parents:
- b82d140
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/rmit.py
rb82d140 r883c4d9 12 12 import datetime 13 13 import itertools 14 import json 14 15 import os 15 16 import random … … 117 118 # ================================================================================ 118 119 # parse command line arguments 119 formats = ['raw', 'csv' ]120 formats = ['raw', 'csv', 'json'] 120 121 parser = argparse.ArgumentParser(description='Python Script to implement R.M.I.T. testing : Randomized Multiple Interleaved Trials') 121 122 parser.add_argument('--list', help='List all the commands that would be run', action='store_true') 122 parser.add_argument('--format', help='How to print the result', choices=formats, default=' csv')123 parser.add_argument('--format', help='How to print the result', choices=formats, default='json') 123 124 parser.add_argument('--file', nargs='?', type=argparse.FileType('w'), default=sys.stdout) 124 125 parser.add_argument('-t', '--trials', help='Number of trials to run per combinaison', type=int, default=3) … … 203 204 204 205 # ================================================================================ 205 # Print csv206 # Print raw 206 207 if options.format == 'raw': 207 208 for r in result: 208 209 print(r, file=options.file) 210 sys.exit(0) 211 212 # ================================================================================ 213 # Print json 214 if options.format == 'json': 215 json.dump(result, options.file) 209 216 sys.exit(0) 210 217
Note: See TracChangeset
for help on using the changeset viewer.