mirror of
https://github.com/newnius/YAO-scheduler.git
synced 2025-06-07 14:21:55 +00:00
update fair
This commit is contained in:
parent
441a716462
commit
0e1ef4bcdf
@ -324,15 +324,13 @@ func (scheduler *SchedulerFair) UpdateQuota() {
|
|||||||
|
|
||||||
pool := InstanceOfResourcePool()
|
pool := InstanceOfResourcePool()
|
||||||
|
|
||||||
availableGPU := pool.TotalGPU - usingGPU - allocatedGPU/1000
|
availableGPU := pool.TotalGPU*1000 - usingGPU*1000 - allocatedGPU
|
||||||
availableCPU := pool.TotalCPU - usingCPU - allocatedCPU/1000
|
availableCPU := pool.TotalCPU*1000 - usingCPU*1000 - allocatedCPU
|
||||||
//availableMemory := pool.TotalMemory - usingMemory - allocatedMemory
|
//availableMemory := pool.TotalMemory - usingMemory - allocatedMemory
|
||||||
/* <0 means some nodes exited */
|
/* <0 means some nodes exited */
|
||||||
if availableGPU <= 0 {
|
if availableGPU <= 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
availableGPU *= 1000
|
|
||||||
availableCPU *= 1000
|
|
||||||
|
|
||||||
var candidates []string
|
var candidates []string
|
||||||
requests := map[string]ResourceCount{}
|
requests := map[string]ResourceCount{}
|
||||||
@ -386,9 +384,9 @@ func (scheduler *SchedulerFair) UpdateQuota() {
|
|||||||
quota.NumberGPU += per * weight
|
quota.NumberGPU += per * weight
|
||||||
availableGPU -= per * weight
|
availableGPU -= per * weight
|
||||||
|
|
||||||
quota.CPU += (requests[queue].CPU / requests[queue].NumberGPU) * per * weight
|
quota.CPU += (requests[queue].CPU * per * weight) / requests[queue].NumberGPU
|
||||||
availableCPU -= (requests[queue].CPU / requests[queue].NumberGPU) * per * weight
|
availableCPU -= (requests[queue].CPU * per * weight) / requests[queue].NumberGPU
|
||||||
quota.Memory += (requests[queue].Memory / requests[queue].NumberGPU) * per * weight / 1000
|
quota.Memory += (requests[queue].Memory * per * weight) / requests[queue].NumberGPU / 1000
|
||||||
}
|
}
|
||||||
log.Info(availableGPU)
|
log.Info(availableGPU)
|
||||||
if availableGPU > 0 {
|
if availableGPU > 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user