Skip to content

Commit

Permalink
configs: restore_simpoint_checkpoint should be a boolean
Browse files Browse the repository at this point in the history
The --restore_simpoint_checkpoint option is a boolean;
however if no default value is supplied, optparse sets the
default value to None

This is not valid for argparse. Argparse recognizes the store_true
action and it is automatically treating the option as a boolean,
hence providing a default=False instead of default=None

Change-Id: I6b09edf6911be71a06001730be1232a1b5c8482c
Signed-off-by: Giacomo Travaglini <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44765
Reviewed-by: Daniel Carvalho <[email protected]>
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
Tested-by: kokoro <[email protected]>
  • Loading branch information
giactra committed Apr 21, 2021
1 parent 503b60e commit 09b9512
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions configs/common/Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ def addCommonOptions(parser):
parser.add_option("--take-simpoint-checkpoints", action="store", type="string",
help="<simpoint file,weight file,interval-length,warmup-length>")
parser.add_option("--restore-simpoint-checkpoint", action="store_true",
default=False,
help="restore from a simpoint checkpoint taken with " +
"--take-simpoint-checkpoints")

Expand Down
2 changes: 1 addition & 1 deletion configs/common/Simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ def run(options, root, testsys, cpu_class):
takeSimpointCheckpoints(simpoints, interval_length, cptdir)

# Restore from SimPoint checkpoints
elif options.restore_simpoint_checkpoint != None:
elif options.restore_simpoint_checkpoint:
restoreSimpointCheckpoint()

else:
Expand Down

0 comments on commit 09b9512

Please sign in to comment.