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

update fair

This commit is contained in:
Newnius 2020-05-28 14:48:58 +08:00
parent b0f30bf25e
commit 88fce67e4c

View File

@ -331,14 +331,6 @@ func (scheduler *SchedulerFair) UpdateQuota() {
if availableGPU <= 0 {
return
}
log.Info("Can allocate ", availableGPU)
log.Info("Before ")
for queue, quota := range scheduler.queuesQuota {
log.Info("Queue<->", queue)
log.Info("GPU:", quota.NumberGPU)
log.Info("CPU:", quota.CPU)
log.Info("Memory:", quota.Memory)
}
availableGPU *= 1000
availableCPU *= 1000
@ -375,6 +367,14 @@ func (scheduler *SchedulerFair) UpdateQuota() {
if len(candidates) == 0 {
return
}
log.Info("Can allocate ", availableGPU)
log.Info("Before ")
for queue, quota := range scheduler.queuesQuota {
log.Info("Queue<->", queue)
log.Info("GPU:", quota.NumberGPU)
log.Info("CPU:", quota.CPU)
log.Info("Memory:", quota.Memory)
}
per := availableGPU / weights
for _, queue := range candidates {
@ -390,6 +390,7 @@ func (scheduler *SchedulerFair) UpdateQuota() {
availableCPU -= (requests[queue].CPU / requests[queue].NumberGPU) * per * weight
quota.Memory += (requests[queue].Memory / requests[queue].NumberGPU) * per * weight / 1000
}
log.Info(availableGPU)
if availableGPU > 0 {
for _, queue := range candidates {
quota := scheduler.queuesQuota[queue]