From 84db0e561ebc73d69436f68706e7f1390f1dba80 Mon Sep 17 00:00:00 2001 From: andrew Date: Wed, 31 Jan 2024 00:50:10 -0500 Subject: [PATCH] Fix for min([]) on empty frameworks --- OpenBench/workloads/get_workload.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OpenBench/workloads/get_workload.py b/OpenBench/workloads/get_workload.py index bacafb6..34fa429 100644 --- a/OpenBench/workloads/get_workload.py +++ b/OpenBench/workloads/get_workload.py @@ -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)]