Skip to content

Commit

Permalink
[PLOT] Fixes to good resource utilization plots.
Browse files Browse the repository at this point in the history
  • Loading branch information
sukritkalra committed Mar 14, 2024
1 parent fcaeb3e commit d76907e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,7 @@ def plot_goodresource_utilization(csv_reader, csv_files, scheduler_labels, outpu
tasks = csv_reader.get_tasks(csv_file)
task_graphs = csv_reader.get_task_graph(csv_file)
good_resource_utilization = {}
simulator_end_time = 0
for task in tasks:
if task.task_graph not in task_graphs:
raise ValueError(f"Graph {task.task_graph} not found in {csv_file}.")
Expand All @@ -1097,6 +1098,8 @@ def plot_goodresource_utilization(csv_reader, csv_files, scheduler_labels, outpu

for t in range(placement.placement_time, placement.completion_time):
good_resource_utilization[resource.name][t] += resource.quantity
if t > simulator_end_time:
simulator_end_time = t

for resource in good_resource_utilization.keys():
worker_pools = csv_reader.get_worker_pools(csv_file)
Expand All @@ -1107,7 +1110,8 @@ def plot_goodresource_utilization(csv_reader, csv_files, scheduler_labels, outpu
max_resource_available += wp_resource.quantity
usage_map = []
wasted_map = []
for t in range(0, csv_reader.get_simulator_end_time(csv_file)):
print(f"Resource {resource} used between 0 and {simulator_end_time}.")
for t in range(0, simulator_end_time):
if t in good_resource_utilization[resource]:
utilization = good_resource_utilization[resource][t]
usage_map.append(utilization)
Expand Down

0 comments on commit d76907e

Please sign in to comment.