sched: Fix resource checks
This commit is contained in:
parent
16f434c790
commit
fd8b91a5d4
@ -20,7 +20,6 @@ func SpreadWS(sh *Scheduler, queueLen int, acceptableWindows [][]int, windows []
|
|||||||
task := (*sh.SchedQueue)[sqi]
|
task := (*sh.SchedQueue)[sqi]
|
||||||
|
|
||||||
selectedWindow := -1
|
selectedWindow := -1
|
||||||
var info storiface.WorkerInfo
|
|
||||||
var bestWid storiface.WorkerID
|
var bestWid storiface.WorkerID
|
||||||
bestAssigned := math.MaxInt // smaller = better
|
bestAssigned := math.MaxInt // smaller = better
|
||||||
|
|
||||||
@ -28,11 +27,11 @@ func SpreadWS(sh *Scheduler, queueLen int, acceptableWindows [][]int, windows []
|
|||||||
wid := sh.OpenWindows[wnd].Worker
|
wid := sh.OpenWindows[wnd].Worker
|
||||||
w := sh.Workers[wid]
|
w := sh.Workers[wid]
|
||||||
|
|
||||||
res := info.Resources.ResourceSpec(task.Sector.ProofType, task.TaskType)
|
res := w.Info.Resources.ResourceSpec(task.Sector.ProofType, task.TaskType)
|
||||||
|
|
||||||
log.Debugf("SCHED try assign sqi:%d sector %d to window %d (awi:%d)", sqi, task.Sector.ID.Number, wnd, i)
|
log.Debugf("SCHED try assign sqi:%d sector %d to window %d (awi:%d)", sqi, task.Sector.ID.Number, wnd, i)
|
||||||
|
|
||||||
if !windows[wnd].Allocated.CanHandleRequest(res, wid, "schedAssign", info) {
|
if !windows[wnd].Allocated.CanHandleRequest(res, wid, "schedAssign", w.Info) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,7 +40,6 @@ func SpreadWS(sh *Scheduler, queueLen int, acceptableWindows [][]int, windows []
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
info = w.Info
|
|
||||||
bestWid = wid
|
bestWid = wid
|
||||||
selectedWindow = wnd
|
selectedWindow = wnd
|
||||||
bestAssigned = wu
|
bestAssigned = wu
|
||||||
|
@ -30,12 +30,12 @@ func LowestUtilizationWS(sh *Scheduler, queueLen int, acceptableWindows [][]int,
|
|||||||
wid := sh.OpenWindows[wnd].Worker
|
wid := sh.OpenWindows[wnd].Worker
|
||||||
w := sh.Workers[wid]
|
w := sh.Workers[wid]
|
||||||
|
|
||||||
res := info.Resources.ResourceSpec(task.Sector.ProofType, task.TaskType)
|
res := w.Info.Resources.ResourceSpec(task.Sector.ProofType, task.TaskType)
|
||||||
|
|
||||||
log.Debugf("SCHED try assign sqi:%d sector %d to window %d (awi:%d)", sqi, task.Sector.ID.Number, wnd, i)
|
log.Debugf("SCHED try assign sqi:%d sector %d to window %d (awi:%d)", sqi, task.Sector.ID.Number, wnd, i)
|
||||||
|
|
||||||
// TODO: allow bigger windows
|
// TODO: allow bigger windows
|
||||||
if !windows[wnd].Allocated.CanHandleRequest(res, wid, "schedAssign", info) {
|
if !windows[wnd].Allocated.CanHandleRequest(res, wid, "schedAssign", w.Info) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user