From c581be947d605ccc1a7cdce0f959273d71325984 Mon Sep 17 00:00:00 2001 From: andrew Date: Fri, 9 Jun 2023 02:59:42 -0400 Subject: [PATCH] Fix error in select_workload() Cross-engine play broke this, by saving the test into the table, instead of test.id --- OpenBench/utils.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/OpenBench/utils.py b/OpenBench/utils.py index 96c3536..e4e089f 100644 --- a/OpenBench/utils.py +++ b/OpenBench/utils.py @@ -549,13 +549,10 @@ def test_maps_onto_thread_count(test, threads, ncutechess, hyperthreads): def select_workload(machine, tests, variance=0.25): - # For reference for later - test_ids = [test.id for test in tests] - # Determine how many threads are assigned to each workload - table = { test : 0 for test in tests } + table = { test.id : 0 for test in tests } for m in getRecentMachines(): - if m.workload in test_ids and m != machine: + if m.workload in table and m != machine: table[m.workload] = table[m.workload] + m.info['concurrency'] # Find the tests most deserving of resources currently @@ -563,7 +560,7 @@ def select_workload(machine, tests, variance=0.25): lowest_idxs = [i for i, r in enumerate(ratios) if r == min(ratios)] # Machine is out of date; or there is an unassigned test - if machine.workload not in test_ids or min(ratios) == 0: + if machine.workload not in table or min(ratios) == 0: return tests[random.choice(lowest_idxs)] # No test has less than (1-variance)% of its deserved resources, and