Final tentative changes to new client, barring testing

This commit is contained in:
Andrew Grant committed 2021-05-28 07:08:23 -04:00
1 parent 6fb21cbd7d
commit 17adbeccf1
8 files changed
+354 -68

No files matched your search

+2
View File
@@ -94,6 +94,8 @@ class Test(Model):
priority = IntegerField(default=0)
throughput = IntegerField(default=0)
allow_dtz = BooleanField(default=True)
force_wdl = BooleanField(default=False)
elolower = FloatField(default=0.0)
eloupper = FloatField(default=0.0)
+13 -12
View File
@@ -1,5 +1,5 @@
body {
font-family: "Montserrat";
font-family: "Courier Prime";
font-size: 18px;
background: #303030;
}
@@ -26,7 +26,7 @@ a:link, a:visited, a:hover, a:active {
}
#sidebar .header {
font-size: 12px;
font-size: 18px;
color: #00AF00;
}
@@ -42,16 +42,14 @@ a:link, a:visited, a:hover, a:active {
text-align: right;
display: inline-block;
color: #A2A2A2;
font-size: 12px;
font-size: 14px;
}
#content input, #content select {
background-color: #BBBBBB;
color: #000000;
padding: 8px;
margin: 2px 0px;
display: inline-block;
vertical-align: middle;
padding: 10px;
margin: 1px 0px;
width: 320px;
box-sizing: border-box;
-moz-box-sizing: border-box;
@@ -116,7 +114,6 @@ a:link, a:visited, a:hover, a:active {
margin: 0px 8px;
border-radius: 16px;
font-weight: bold;
font-family: "Courier New";
text-align: center;
display: inline-block;
width: 25%;
@@ -166,7 +163,6 @@ a:link, a:visited, a:hover, a:active {
#content th {
color: #00AF00;
font-size: 16px;
font-family: "Courier New";
font-weight: 100;
padding: 7px 12px 5px 12px;
background-color: #000000;
@@ -174,7 +170,6 @@ a:link, a:visited, a:hover, a:active {
#content td {
padding: 7px 12px 5px 12px;
font-family: "Courier New";
}
#content .numeric {
@@ -195,6 +190,7 @@ a:link, a:visited, a:hover, a:active {
color: black;
background-color: #CCCCCC;
border-radius: 4px;
font-family: "Courier New";
}
#content .green {
@@ -270,12 +266,17 @@ a:link, a:visited, a:hover, a:active {
}
#content form h3 {
margin-left: 140px;
margin-bottom: 0px;
margin-left: 110px;
margin-bottom: 2px;
font-size: 16px;
font-weight: normal;
color: #00AF00;
}
#content h4 a {
font-size: 18px;
}
#content form .settings-column {
float: left;
padding-bottom: 16px;
+13 -8
View File
@@ -243,6 +243,8 @@ def createNewTest(request):
test.timecontrol = request.POST['timecontrol']
test.priority = int(request.POST['priority'])
test.throughput = int(request.POST['throughput'])
test.allow_dtz = request.POST['allow_dtz'] == 'True'
test.force_wdl = request.POST['force_dtz'] == 'True'
test.elolower = float(request.POST['elolower'])
test.eloupper = float(request.POST['eloupper'])
test.alpha = float(request.POST['alpha'])
@@ -318,6 +320,10 @@ def getWorkload(user, request):
if flag not in cpuflags:
tests = tests.exclude(engine=engine)
# Remove Syzygy tests if the Machine has no TBs
if not request.POST['syzygy_dtz']:
tests = tests.exclude(force_wdl=True)
# If we don't get a Test back, there was an error
test = selectWorkload(tests, machine)
if type(test) == str: return test
@@ -349,12 +355,7 @@ def selectWorkload(tests, machine):
elif options and test.priority == highest:
options.append(test)
if not options: return 'None'
target = random.randrange(sum([t.throughput for t in options]))
while True: # Select a random test used weighted randomness
if target < options[0].throughput: return options[0]
target -= options[0].throughput; options = options[1:]
return ['None', random.choice(options)][len(options) != 0]
def workloadDictionary(test, result, machine):
@@ -371,11 +372,15 @@ def workloadDictionary(test, result, machine):
'test' : {
'id' : test.id,
'engine' : test.engine,
'timecontrol' : test.timecontrol,
'throughput' : test.throughput,
'allow_dtz' : test.allow_dtz,
'force_wdl' : test.force_wdl,
'nps' : OPENBENCH_CONFIG['engines'][test.engine]['nps'],
'build' : OPENBENCH_CONFIG['engines'][test.engine]['build'],
'book' : OPENBENCH_CONFIG['books'][test.bookname],
'timecontrol' : test.timecontrol,
'engine' : test.engine,
'dev' : {
'id' : test.dev.id, 'name' : test.dev.name,