Changeset 9d264e1 for benchmark/rmit.py


Ignore:
Timestamp:
Nov 12, 2020, 1:29:43 PM (12 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
b5344a3
Parents:
d6ad99e (diff), 8ca26d5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/rmit.py

    rd6ad99e r9d264e1  
    1212import datetime
    1313import itertools
     14import json
    1415import os
    1516import random
     
    117118        # ================================================================================
    118119        # parse command line arguments
    119         formats = ['raw', 'csv']
     120        formats = ['raw', 'csv', 'json']
    120121        parser = argparse.ArgumentParser(description='Python Script to implement R.M.I.T. testing : Randomized Multiple Interleaved Trials')
    121122        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')
    123124        parser.add_argument('--file', nargs='?', type=argparse.FileType('w'), default=sys.stdout)
    124125        parser.add_argument('-t', '--trials', help='Number of trials to run per combinaison', type=int, default=3)
     
    203204
    204205        # ================================================================================
    205         # Print csv
     206        # Print raw
    206207        if options.format == 'raw':
    207208                for r in result:
    208209                        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)
    209216                sys.exit(0)
    210217
Note: See TracChangeset for help on using the changeset viewer.