Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Communicate task completion to Scheduler interface. Add two schedulers #253

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sacheendra
Copy link
Contributor

Summary

Currently, the scheduling cycle for each task scans all available hosts. This is necessary because the scheduler doesn't know each host's capacity.
The scheduler can track each host's capacity if it knowns when each task starts and ends. I added an additional function to the scheduler interface to track task ends. The scheduler now also receives multiple tasks to schedule at a time, rather than just one.

Using the interface, I implement two new schedulers: 1) A memorizing one, which uses a calender priority queue to track which host is least occupied. 2) A power of two random choices scheduler.

Implementation Notes ⚒️

  • The scheduler now accept multiple tasks with a select(iter: MutableIterator<Task>): HostView? interface instead of select(task: Task): HostView?. This allows the scheduler to pick a task which is not at the top of the queue.
  • The Task interface now has a field, timeSkipped, which keeps track of how many time the task was skipped when it was at the head of the queue. If a task has been skipped a specified maximum number of times, no other task is scheduled until this one is.

External Dependencies 🍀

Breaking API Changes ⚠️

Simply specify none (N/A) if not applicable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant