1
0
mirror of https://github.com/newnius/YAO-scheduler.git synced 2025-12-12 23:36:44 +00:00
This commit is contained in:
2020-04-13 01:30:25 +08:00
parent 4ce9378bf6
commit 533099c14b
4 changed files with 55 additions and 5 deletions

View File

@@ -206,6 +206,10 @@ func (scheduler *SchedulerFair) ReleaseResource(job Job, agent NodeStatus) {
for j := range nodes.Status {
if gpu.UUID == nodes.Status[j].UUID {
nodes.Status[j].MemoryAllocated -= gpu.MemoryTotal
if nodes.Status[j].MemoryAllocated < 0 {
// in case error
nodes.Status[j].MemoryAllocated = 0
}
}
}
}
@@ -376,4 +380,4 @@ func (scheduler *SchedulerFair) Attach(GPU string, job string) {
func (scheduler *SchedulerFair) Detach(GPU string, job string) {
pool.detach(GPU, job)
}
}