1
0
mirror of https://github.com/newnius/YAO-scheduler.git synced 2025-06-07 14:21:55 +00:00

update preempt

This commit is contained in:
Newnius 2020-06-04 10:22:21 +08:00
parent 02ae5a4483
commit 4d95d15749

View File

@ -94,8 +94,8 @@ func (scheduler *SchedulerPriority) Start() {
numberGPUt += task.NumberGPU
}
needGPU := InstanceOfResourcePool().TotalGPU - InstanceOfResourcePool().UsingGPU
score = float64(time.Now().UnixNano()/100000-int64(jobT.CreatedAt)) * math.Abs(float64(numberGPU-numberGPUt+needGPU)) / float64(numberGPUt)
needGPU := numberGPU - (InstanceOfResourcePool().TotalGPU - InstanceOfResourcePool().UsingGPU)
score = float64(time.Now().UnixNano()/100000-int64(jobT.CreatedAt)) * math.Abs(float64(numberGPU-needGPU)) / float64(numberGPUt)
if score < minScore {
minScore = score