Skip to content

Commit

Permalink
Cancel TaskGraphs that cannot meet their deadlines.
Browse files Browse the repository at this point in the history
  • Loading branch information
sukritkalra committed Mar 27, 2024
1 parent 538cef1 commit acea704
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions schedulers/tetrisched_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,21 @@ def _cancel_task_graphs(
f"Could not find TaskGraph with name {task_graph_name}."
)

# If we are enforcing deadlines and there is no way to meet this TaskGraph's
# deadline, then we cancel it upfront.
if (
self.enforce_deadlines
and current_time + task_graph.get_remaining_time() > task_graph.deadline
):
self._logger.debug(
f"[{current_time.time}] Cancelling TaskGraph {task_graph_name} "
f"since the remaining time is {task_graph.get_remaining_time()} "
f"and the deadline is {task_graph.deadline}. The earliest it "
f"could finish is {current_time + task_graph.get_remaining_time()}"
)
cancelled_task_graphs.add(task_graph_name)
continue

# TaskGraphs that have been previously scheduled cannot be cancelled
# upfront since they already have a feasible placement. The scheduler
# must choose to cancel or keep them later.
Expand Down

0 comments on commit acea704

Please sign in to comment.