diff --git a/src/scheduler_priority.go b/src/scheduler_priority.go index 756e3d8..5ef0e43 100644 --- a/src/scheduler_priority.go +++ b/src/scheduler_priority.go @@ -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