aboutsummaryrefslogtreecommitdiff
path: root/benchmark.py
diff options
context:
space:
mode:
authorthecharlesblake2018-01-10 18:14:28 +0000
committerthecharlesblake2018-01-10 18:14:59 +0000
commitc0ca8cc4b13c0a4953519658d8fe7e27980a5651 (patch)
tree4b637f7522f2a8a79d0c3eeff17bf2cef8e4804c /benchmark.py
parentAdd results table to benchmark script (diff)
downloadmetasol-c0ca8cc4b13c0a4953519658d8fe7e27980a5651.tar.gz
metasol-c0ca8cc4b13c0a4953519658d8fe7e27980a5651.zip

Add debug mode to benchmark script

Diffstat (limited to 'benchmark.py')
-rw-r--r--benchmark.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/benchmark.py b/benchmark.py
index fa13c7b..1eaf9f4 100644
--- a/benchmark.py
+++ b/benchmark.py
@@ -11,6 +11,12 @@ tempRulesFilename = "temp_rules.json"
timeoutsLimit = 4
timeoutSeconds = 1
+runtype = "release"
+if (len(sys.argv) == 2
+ and (sys.argv[1] == "--debug" or sys.argv[1] == "-d")):
+ runtype = "debug"
+ print("Running in debug mode...")
+
class SolitaireRulesGen(metaclass=ABCMeta):
def __init__(self, name):
@@ -160,7 +166,7 @@ for rulesGen in [SpanishPatienceRulesGen(),
timeouts = 0
for attempt in range(20):
try:
- run("./cmake-build-release/bin/solvitaire --rules "
+ run("./cmake-build-" + runtype + "/bin/solvitaire --rules "
+ tempRulesFilename + " --random " + str(attempt + 1),
shell=True,
check=True,
@@ -172,6 +178,7 @@ for rulesGen in [SpanishPatienceRulesGen(),
except CalledProcessError:
print("Error running " + rulesGen.name + " at level "
+ str(level) + " with seed " + str(attempt + 1) + "!")
+ print(str(rulesGen) + "\n")
sys.exit()
except:
print("Unknown error in script")