Skip to content

Commit

Permalink
Enable EDF to only drop tasks if requested. Add an adversarial EDF co…
Browse files Browse the repository at this point in the history
…nfig.
  • Loading branch information
sukritkalra committed Dec 17, 2023
1 parent c90eb51 commit 5b71e13
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
22 changes: 22 additions & 0 deletions configs/edf_adversarial.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Output configs.
--log=./edf_adversarial.log
--log_level=debug
--csv=./edf_adversarial.csv

# Task configs.
--runtime_variance=0

# Scheduler configs.
#--scheduler=TetriSched_Gurobi
#--scheduler=TetriSched
--scheduler=EDF
--scheduler_runtime=0
--enforce_deadlines
--retract_schedules
#--release_taskgraphs
#--scheduler_time_discretization=1

# Execution mode configs.
--execution_mode=json
--workload_profile_path=./profiles/workload/edf_adversarial.yaml
--worker_profile_path=./profiles/workers/edf_adversarial.yaml
5 changes: 4 additions & 1 deletion schedulers/edf_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def __init__(
enforce_deadlines=enforce_deadlines,
_flags=_flags,
)
self._drop_skipped_tasks = _flags.drop_skipped_tasks if _flags else False

def schedule(
self, sim_time: EventTime, workload: Workload, worker_pools: WorkerPools
Expand Down Expand Up @@ -103,12 +104,14 @@ def schedule(
)

# If we are enforcing deadlines, and the Task is past its deadline, then
# we should create a cancellation for it.
# we should create a cancellation for it. This is only applicable if the
# user wants the tasks that cannot meet their deadline to be dropped.
if (
self.enforce_deadlines
and task.deadline
< sim_time
+ task.available_execution_strategies.get_fastest_strategy().runtime
and self._drop_skipped_tasks
):
placements.append(Placement.create_task_cancellation(task=task))
self._logger.debug(
Expand Down

0 comments on commit 5b71e13

Please sign in to comment.