1
0
mirror of https://github.com/newnius/YAO-scheduler.git synced 2025-12-15 16:16:44 +00:00
This commit is contained in:
2020-04-30 19:22:23 +08:00
parent c6e82bc3e3
commit 420a1263bc

View File

@@ -350,6 +350,9 @@ func (scheduler *SchedulerFair) AcquireResource(job Job, task Task) NodeStatus {
} }
} }
} }
if allocationType == 2 {
scheduler.UsingGPU += task.NumberGPU
}
} }
for i := range locks { for i := range locks {
@@ -392,6 +395,9 @@ func (scheduler *SchedulerFair) ReleaseResource(job Job, agent NodeStatus) {
log.Warn(node.ClientID, "More Memory Allocated") log.Warn(node.ClientID, "More Memory Allocated")
node.Status[j].MemoryAllocated = 0 node.Status[j].MemoryAllocated = 0
} }
if node.Status[j].MemoryAllocated == 0 {
scheduler.UsingGPU--
}
log.Info(node.Status[j].MemoryAllocated) log.Info(node.Status[j].MemoryAllocated)
} }
} }