Fix for min([]) on empty frameworks
This commit is contained in:
1 parent
6bbbeeeaad
commit
84db0e561e
1 file changed
+6
@@ -57,6 +57,8 @@ def select_workload(machine):
|
||||
|
||||
# Step 1: Refine active workloads to the candidate assignments
|
||||
candidates, has_focus = filter_valid_workloads(machine)
|
||||
if not candidates:
|
||||
return None
|
||||
|
||||
# Step 2: Count relevant threads on each candidate test
|
||||
worker_dist, engine_freq = compute_resource_distribution(candidates, machine, has_focus)
|
||||
@@ -104,6 +106,10 @@ def filter_valid_workloads(machine):
|
||||
# Skip workloads that we have insufficient threads to play
|
||||
options = [x for x in workloads if valid_hardware_assignment(x, machine)]
|
||||
|
||||
# Possible that no work exists for the machine
|
||||
if not options:
|
||||
return [], False
|
||||
|
||||
# Refine to workloads of the highest priority
|
||||
priorities = [x.priority for x in options]
|
||||
candidates = [x for x in options if x.priority == max(priorities)]
|
||||
|
||||
Reference in new issue
Block a user