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
c804102e4b
commit
618206b7d5
@ -310,18 +310,24 @@ func (scheduler *SchedulerFair) UpdateQuota() {
|
|||||||
log.Info("Updating queues quota~")
|
log.Info("Updating queues quota~")
|
||||||
|
|
||||||
usingGPU := 0
|
usingGPU := 0
|
||||||
|
allocatedGPU := 0
|
||||||
scheduler.resourceAllocationsMu.Lock()
|
scheduler.resourceAllocationsMu.Lock()
|
||||||
for _, queue := range scheduler.resourceAllocations {
|
for _, quota := range scheduler.resourceAllocations {
|
||||||
usingGPU += queue.NumberGPU
|
usingGPU += quota.NumberGPU
|
||||||
}
|
}
|
||||||
scheduler.resourceAllocationsMu.Unlock()
|
scheduler.resourceAllocationsMu.Unlock()
|
||||||
|
|
||||||
|
for _, quota := range scheduler.queuesQuota {
|
||||||
|
allocatedGPU += quota.NumberGPU
|
||||||
|
}
|
||||||
|
|
||||||
pool := InstanceOfResourcePool()
|
pool := InstanceOfResourcePool()
|
||||||
|
|
||||||
available := pool.TotalGPU - usingGPU
|
available := pool.TotalGPU - usingGPU - allocatedGPU
|
||||||
log.Info("Can allocate ", available)
|
log.Info("Can allocate ", available)
|
||||||
log.Info("Before ")
|
log.Info("Before ")
|
||||||
for _, quota := range scheduler.queuesQuota {
|
for queue, quota := range scheduler.queuesQuota {
|
||||||
|
log.Info("Queue<->", queue)
|
||||||
log.Info("GPU:", quota.NumberGPU)
|
log.Info("GPU:", quota.NumberGPU)
|
||||||
log.Info("CPU:", quota.CPU)
|
log.Info("CPU:", quota.CPU)
|
||||||
log.Info("Memory:", quota.Memory)
|
log.Info("Memory:", quota.Memory)
|
||||||
@ -343,7 +349,8 @@ func (scheduler *SchedulerFair) UpdateQuota() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.Info("After ")
|
log.Info("After ")
|
||||||
for _, quota := range scheduler.queuesQuota {
|
for queue, quota := range scheduler.queuesQuota {
|
||||||
|
log.Info("Queue<->", queue)
|
||||||
log.Info("GPU:", quota.NumberGPU)
|
log.Info("GPU:", quota.NumberGPU)
|
||||||
log.Info("CPU:", quota.CPU)
|
log.Info("CPU:", quota.CPU)
|
||||||
log.Info("Memory:", quota.Memory)
|
log.Info("Memory:", quota.Memory)
|
||||||
|
Loading…
Reference in New Issue
Block a user