diff --git a/Client/Client.py b/Client/Client.py index 296db4e..4c1a58b 100644 --- a/Client/Client.py +++ b/Client/Client.py @@ -51,7 +51,6 @@ TIMEOUT_WORKLOAD = 30 # Timeout in seconds between workload requests CLIENT_VERSION = '7' # Client version to send to the Server SYZYGY_WDL_PATH = None # Pathway to WDL Syzygy Tables -BASE_GAMES_PER_CORE = 32 # Typical games played per-thread FLEET_MODE = False # Exit when there are no workloads ERRORS = { @@ -901,9 +900,8 @@ def build_cutechess_command(arguments, workload, dev_cmd, base_cmd, nps, cuteche concurrency = int(arguments.threads) / int(arguments.ncutechess) concurrency = concurrency // max(dev_threads, base_threads) - update_interval = 8 if max(dev_threads, base_threads) == 1 else 1 - games = int(concurrency * BASE_GAMES_PER_CORE) + games = int(concurrency * workload['test']['workload_size']) games = max(8, concurrency * 2, games - (games % (2 * concurrency))) time_control = scale_time_control(workload, nps) @@ -918,10 +916,10 @@ def build_cutechess_command(arguments, workload, dev_cmd, base_cmd, nps, cuteche ) if IS_LINUX: - return concurrency, update_interval, './cutechess-ob ' + flags % (args) - return concurrency, update_interval, 'cutechess-ob.exe ' + flags % (args) + return concurrency, './cutechess-ob ' + flags % (args) + return concurrency, 'cutechess-ob.exe ' + flags % (args) -def run_and_parse_cutechess(arguments, workload, concurrency, update_interval, command, cutechess_idx): +def run_and_parse_cutechess(arguments, workload, concurrency, command, cutechess_idx): print('\n[#%d] Launching Cutechess...\n%s\n' % (cutechess_idx, command)) cutechess = Popen(command.split(), stdout=PIPE) @@ -958,7 +956,7 @@ def run_and_parse_cutechess(arguments, workload, concurrency, update_interval, c # Only report scores after every eight games score = list(map(int, score_reason.split()[0:5:2])) - if ((sum(score) - sum(sent)) % update_interval != 0): continue + if ((sum(score) - sum(sent)) % workload['test']['report_rate'] != 0): continue # Report to the server but allow failed reports to delay wld = [score[ii] - sent[ii] for ii in range(3)] diff --git a/OpenBench/models.py b/OpenBench/models.py index 92b4303..09a7cd9 100644 --- a/OpenBench/models.py +++ b/OpenBench/models.py @@ -106,6 +106,10 @@ class Test(Model): win_adj = CharField(max_length=64, default='movecount=3 score=400') draw_adj = CharField(max_length=64, default='movenumber=40 movecount=8 score=10') + # Client configuration + report_rate = IntegerField(default=8) + workload_size = IntegerField(default=32) + # Only for SPRT Tests elolower = FloatField(default=0.0) eloupper = FloatField(default=0.0) diff --git a/OpenBench/static/style.css b/OpenBench/static/style.css index 610b195..dbf43df 100644 --- a/OpenBench/static/style.css +++ b/OpenBench/static/style.css @@ -17,14 +17,14 @@ a:link, a:visited, a:hover, a:active { #sidebar ul { list-style-type: none; - padding: 0px 16px 0px 8px; - line-height: 1.75; + padding: 0px 0px 0px 8px; + line-height: 1.50; } #sidebar li a { color: #A2A2A2; padding: 0px 16px; - font-size: 1.0rem; + font-size: 16px; } #sidebar li:hover { @@ -35,7 +35,7 @@ a:link, a:visited, a:hover, a:active { #sidebar .header { color: #00AF00; padding: 0px 16px; - font-size: 1.0rem; + font-size: 16px; } #sidebar .header:hover { @@ -58,14 +58,19 @@ a:link, a:visited, a:hover, a:active { } #content input, #content select { + background-color: #BBBBBB; color: #000000; padding: 10px; margin: 1px 0px; - width: 320px; - box-sizing: border-box; + width: 340px; + + border: 2px solid black; + border-radius: 6px; + -moz-box-sizing: border-box; -webkit-box-sizing: border-box; + box-sizing: border-box; } #content button { diff --git a/OpenBench/utils.py b/OpenBench/utils.py index 1a0dd08..eaa6ab0 100644 --- a/OpenBench/utils.py +++ b/OpenBench/utils.py @@ -288,9 +288,9 @@ def verifyNewTest(request): try: int(request.POST[field]) except: errors.append('"{0}" is not an Integer'.format(fieldName)) - def verifyGreaterThan(field, fieldName, value, valueName): + def verifyGreaterThan(field, fieldName, value): if not float(request.POST[field]) > value: - errors.append('"{0}" is not greater than {1}'.format(fieldName, valueName)) + errors.append('"{0}" is not greater than {1}'.format(fieldName, value)) def verifyOptions(field, option, fieldName): if extractOption(request.POST[field], option) == None: @@ -317,9 +317,18 @@ def verifyNewTest(request): except: errors.append('"{0}" is not a parsable Draw Adjudication Seting'.format(content)) verifications = [ - (verifyInteger, 'priority', 'Priority'), - (verifyInteger, 'throughput', 'Throughput'), - (verifyGreaterThan, 'throughput', 'Throughput', 0, '0'), + + # Must have all of these values for test settings + (verifyInteger, 'priority', 'Priority' ), + (verifyInteger, 'throughput', 'Throughput' ), + (verifyInteger, 'report_rate', 'Report Rate' ), + (verifyInteger, 'workload_size', 'Workload Size'), + + # Can't allow non-natural values for any of these fields + (verifyGreaterThan, 'throughput', 'Throughput', 0), + (verifyGreaterThan, 'report_rate', 'Report Rate', 0), + (verifyGreaterThan, 'workload_size', 'Workload Size', 0), + (verifyOptions, 'devoptions', 'Threads', 'Dev Options'), (verifyOptions, 'devoptions', 'Hash', 'Dev Options'), (verifyOptions, 'baseoptions', 'Threads', 'Base Options'), @@ -346,23 +355,25 @@ def createNewTest(request): baseinfo, base_has_all = collect_github_info(request, errors, 'base') if errors != []: return None, errors - test = Test() - test.author = request.user.username - test.engine = request.POST['enginename'] - test.test_mode = request.POST['test_mode'] - test.source = request.POST['source'] - test.devoptions = request.POST['devoptions'].rstrip(' ') - test.baseoptions = request.POST['baseoptions'].rstrip(' ') - test.devnetwork = request.POST['devnetwork'] - test.basenetwork = request.POST['basenetwork'] - test.bookname = request.POST['bookname'] - test.timecontrol = parseTimeControl(request.POST['timecontrol']) - test.priority = int(request.POST['priority']) - test.throughput = int(request.POST['throughput']) - test.syzygy_wdl = request.POST['syzygy_wdl'] - test.syzygy_adj = request.POST['syzygy_adj'] - test.win_adj = request.POST['win_adj'] - test.draw_adj = request.POST['draw_adj'] + test = Test() + test.author = request.user.username + test.engine = request.POST['enginename'] + test.test_mode = request.POST['test_mode'] + test.source = request.POST['source'] + test.devoptions = request.POST['devoptions'].rstrip(' ') + test.baseoptions = request.POST['baseoptions'].rstrip(' ') + test.devnetwork = request.POST['devnetwork'] + test.basenetwork = request.POST['basenetwork'] + test.bookname = request.POST['bookname'] + test.timecontrol = parseTimeControl(request.POST['timecontrol']) + test.priority = int(request.POST['priority']) + test.throughput = int(request.POST['throughput']) + test.syzygy_wdl = request.POST['syzygy_wdl'] + test.syzygy_adj = request.POST['syzygy_adj'] + test.win_adj = request.POST['win_adj'] + test.draw_adj = request.POST['draw_adj'] + test.report_rate = int(request.POST['report_rate']) + test.workload_size = int(request.POST['workload_size']) if request.POST['test_mode'] == 'SPRT': test.elolower = float(request.POST['bounds'].split(',')[0].lstrip('[')) @@ -531,18 +542,21 @@ def workload_to_dictionary(test, result, machine): 'test' : { - 'id' : test.id, - 'engine' : test.engine, - 'timecontrol' : test.timecontrol, - 'syzygy_wdl' : test.syzygy_wdl, + 'id' : test.id, + 'engine' : test.engine, + 'timecontrol' : test.timecontrol, + 'syzygy_wdl' : test.syzygy_wdl, - 'syzygy_adj' : test.syzygy_adj, - 'win_adj' : test.win_adj, - 'draw_adj' : test.draw_adj, + 'syzygy_adj' : test.syzygy_adj, + 'win_adj' : test.win_adj, + 'draw_adj' : test.draw_adj, - 'nps' : OPENBENCH_CONFIG['engines'][test.engine]['nps'], - 'build' : OPENBENCH_CONFIG['engines'][test.engine]['build'], - 'book' : OPENBENCH_CONFIG['books'][test.bookname], + 'report_rate' : test.report_rate, + 'workload_size' : test.workload_size, + + 'nps' : OPENBENCH_CONFIG['engines'][test.engine]['nps'], + 'build' : OPENBENCH_CONFIG['engines'][test.engine]['build'], + 'book' : OPENBENCH_CONFIG['books'][test.bookname], 'dev' : { 'id' : test.dev.id, 'name' : test.dev.name, diff --git a/OpenBench/views.py b/OpenBench/views.py index 4cf13a2..f96d117 100644 --- a/OpenBench/views.py +++ b/OpenBench/views.py @@ -420,9 +420,9 @@ def test(request, id, action=None): return django.http.HttpResponseRedirect('/index/') if action not in ['APPROVE', 'RESTART', 'STOP', 'DELETE', 'MODIFY']: - test = Test.objects.get(id=id) + test = Test.objects.get(id=id) results = Result.objects.filter(test=test).order_by('machine_id') - data = {'test' : test, 'results': results} + data = {'test' : test, 'results': results} return render(request, 'test.html', data) if not request.user.is_authenticated: @@ -445,11 +445,13 @@ def test(request, id, action=None): if action == 'DELETE' : test.deleted = True; test.save() if action == 'MODIFY': - test.priority = int(request.POST['priority']) - test.throughput = max(1, int(request.POST['throughput'])) + test.priority = int(request.POST['priority']) + test.throughput = max(1, int(request.POST['throughput'])) + test.report_rate = max(1, int(request.POST['report_rate'])) + test.workload_size = max(1, int(request.POST['workload_size'])) test.save() - action += " P={0} TP={1}".format(test.priority, test.throughput) + action += " P=%d TP=%d RR=%d WS=%d" % (test.priority, test.throughput, test.report_rate, test.workload_size) LogEvent.objects.create(author=user.username, summary=action, log_file='', test_id=test.id) return django.http.HttpResponseRedirect('/index/') diff --git a/Templates/OpenBench/newTest.html b/Templates/OpenBench/newTest.html index dc79e67..41e1fba 100644 --- a/Templates/OpenBench/newTest.html +++ b/Templates/OpenBench/newTest.html @@ -40,7 +40,7 @@ ]; - function set_test_type(type) { + function set_test_type() { //// When the test mode is set or changed, run this. //// Sets the bounds, confidence intervals, and max games fields. @@ -73,6 +73,9 @@ var engine = selection.options[selection.selectedIndex].value; var mode = TestModes[engine][mode_idx]; + document.getElementById("report_rate").value = mode["report_rate"] || 8; + document.getElementById("workload_size").value = mode["workload_size"] || 32; + if (mode["th"] != null && mode["hash"] != null) { var threads = mode["th"]; var hash = mode["hash"]; document.getElementById("devoptions").value = "Threads=" + threads + " Hash=" + hash; @@ -168,6 +171,8 @@ document.getElementById("bookname" ).value = Configurations[engine]["book"]; document.getElementById("win_adj" ).value = Configurations[engine]["win_adj"]; document.getElementById("draw_adj" ).value = Configurations[engine]["draw_adj"]; + + set_test_mode(0); } document.addEventListener( @@ -206,6 +211,10 @@

+

Workload Settings

+
+ +
diff --git a/Templates/OpenBench/test.html b/Templates/OpenBench/test.html index 7bf1395..6d21369 100644 --- a/Templates/OpenBench/test.html +++ b/Templates/OpenBench/test.html @@ -39,7 +39,6 @@ Syzygy ADJ.{{test.syzygy_adj}} Win ADJ.{{test.win_adj}} Draw ADJ.{{test.draw_adj}} -
@@ -94,6 +93,8 @@

+
+
{% if profile.approver or profile.user.username == test.author %}