From 869ce5487d14ef04341faa7d772874829958e4a1 Mon Sep 17 00:00:00 2001 From: AndyGrant Date: Mon, 25 Jun 2018 14:45:32 -0400 Subject: [PATCH] On compile error, force bench=0 to stop bad test. Fixes hangs --- Client/OpenBench.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Client/OpenBench.py b/Client/OpenBench.py index 0cc3556..a1c36ea 100644 --- a/Client/OpenBench.py +++ b/Client/OpenBench.py @@ -231,17 +231,21 @@ def getCutechessCommand(data, scalefactor): def singleCoreBench(name, outqueue): - # Format file path because of Windows .... - dir = os.path.join('Engines', getNameAsExe(name)) + try: + # Format file path because of Windows .... + dir = os.path.join('Engines', getNameAsExe(name)) - # Last two lines should hold node count and NPS - data = os.popen('{0} bench'.format(dir)).read() - data = data.strip().split('\n') + # Last two lines should hold node count and NPS + data = os.popen('{0} bench'.format(dir)).read() + data = data.strip().split('\n') - # Parse and dump results into queue - bench = int(data[-2].split(':')[1]) - nps = int(data[-1].split(':')[1]) - outqueue.put((bench, nps)) + # Parse and dump results into queue + bench = int(data[-2].split(':')[1]) + nps = int(data[-1].split(':')[1]) + outqueue.put((bench, nps)) + + # Bad compile or bad output, force an error + except: outqueue.put((0, 0)) def getBenchSignature(engine):