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

update preempt

This commit is contained in:
Newnius 2020-06-03 20:43:42 +08:00
parent 33041d3a45
commit 02ae5a4483

View File

@ -93,9 +93,9 @@ func (scheduler *SchedulerPriority) Start() {
for _, task := range jobT.Tasks {
numberGPUt += task.NumberGPU
}
log.Info(time.Now().UnixNano())
needGPU := InstanceOfResourcePool().TotalGPU - InstanceOfResourcePool().UsingGPU
score = float64(jobT.CreatedAt) * math.Abs(float64(numberGPU-numberGPUt+needGPU)) / float64(numberGPUt)
score = float64(time.Now().UnixNano()/100000-int64(jobT.CreatedAt)) * math.Abs(float64(numberGPU-numberGPUt+needGPU)) / float64(numberGPUt)
if score < minScore {
minScore = score