Merged in tasksToScheduleWindow (pull request #5)
TasksToScheduleWindow Approved-by: Akash Kothawale <akothaw1@binghamton.edu>
This commit is contained in:
parent
b1bd21f730
commit
25bf363d2c
4 changed files with 16 additions and 0 deletions
|
@ -171,6 +171,10 @@ func (s *MaxGreedyMins) ConsumeOffers(spc SchedPolicyContext, driver sched.Sched
|
||||||
|
|
||||||
// Switch scheduling policy only if feature enabled from CLI
|
// Switch scheduling policy only if feature enabled from CLI
|
||||||
if baseSchedRef.schedPolSwitchEnabled {
|
if baseSchedRef.schedPolSwitchEnabled {
|
||||||
|
// Need to recompute the schedWindow for the next offer cycle.
|
||||||
|
// The next scheduling policy will schedule at max schedWindow number of tasks.
|
||||||
|
baseSchedRef.curSchedWindow = baseSchedRef.schedWindowResStrategy.Apply(
|
||||||
|
func() interface{} { return baseSchedRef.tasks })
|
||||||
// Switching to a random scheduling policy.
|
// Switching to a random scheduling policy.
|
||||||
// TODO: Switch based on some criteria.
|
// TODO: Switch based on some criteria.
|
||||||
index := rand.Intn(len(SchedPolicies))
|
index := rand.Intn(len(SchedPolicies))
|
||||||
|
|
|
@ -165,6 +165,10 @@ func (s *MaxMin) ConsumeOffers(spc SchedPolicyContext, driver sched.SchedulerDri
|
||||||
|
|
||||||
// Switch scheduling policy only if feature enabled from CLI
|
// Switch scheduling policy only if feature enabled from CLI
|
||||||
if baseSchedRef.schedPolSwitchEnabled {
|
if baseSchedRef.schedPolSwitchEnabled {
|
||||||
|
// Need to recompute the schedWindow for the next offer cycle.
|
||||||
|
// The next scheduling policy will schedule at max schedWindow number of tasks.
|
||||||
|
baseSchedRef.curSchedWindow = baseSchedRef.schedWindowResStrategy.Apply(
|
||||||
|
func() interface{} { return baseSchedRef.tasks })
|
||||||
// Switching to a random scheduling policy.
|
// Switching to a random scheduling policy.
|
||||||
// TODO: Switch based on some criteria.
|
// TODO: Switch based on some criteria.
|
||||||
index := rand.Intn(len(SchedPolicies))
|
index := rand.Intn(len(SchedPolicies))
|
||||||
|
|
|
@ -115,6 +115,10 @@ func (s *BinPackSortedWatts) ConsumeOffers(spc SchedPolicyContext, driver sched.
|
||||||
|
|
||||||
// Switch scheduling policy only if feature enabled from CLI
|
// Switch scheduling policy only if feature enabled from CLI
|
||||||
if baseSchedRef.schedPolSwitchEnabled {
|
if baseSchedRef.schedPolSwitchEnabled {
|
||||||
|
// Need to recompute the schedWindow for the next offer cycle.
|
||||||
|
// The next scheduling policy will schedule at max schedWindow number of tasks.
|
||||||
|
baseSchedRef.curSchedWindow = baseSchedRef.schedWindowResStrategy.Apply(
|
||||||
|
func() interface{} { return baseSchedRef.tasks })
|
||||||
// Switching to a random scheduling policy.
|
// Switching to a random scheduling policy.
|
||||||
// TODO: Switch based on some criteria.
|
// TODO: Switch based on some criteria.
|
||||||
index := rand.Intn(len(SchedPolicies))
|
index := rand.Intn(len(SchedPolicies))
|
||||||
|
|
|
@ -101,6 +101,10 @@ func (s *FirstFit) ConsumeOffers(spc SchedPolicyContext, driver sched.SchedulerD
|
||||||
|
|
||||||
// Switch scheduling policy only if feature enabled from CLI
|
// Switch scheduling policy only if feature enabled from CLI
|
||||||
if baseSchedRef.schedPolSwitchEnabled {
|
if baseSchedRef.schedPolSwitchEnabled {
|
||||||
|
// Need to recompute the schedWindow for the next offer cycle.
|
||||||
|
// The next scheduling policy will schedule at max schedWindow number of tasks.
|
||||||
|
baseSchedRef.curSchedWindow = baseSchedRef.schedWindowResStrategy.Apply(
|
||||||
|
func() interface{} { return baseSchedRef.tasks })
|
||||||
// Switching to a random scheduling policy.
|
// Switching to a random scheduling policy.
|
||||||
// TODO: Switch based on some criteria.
|
// TODO: Switch based on some criteria.
|
||||||
index := rand.Intn(len(SchedPolicies))
|
index := rand.Intn(len(SchedPolicies))
|
||||||
|
|
Reference in a new issue