1
0
mirror of https://github.com/newnius/YAO-scheduler.git synced 2025-12-13 07:46:43 +00:00
This commit is contained in:
2020-04-30 21:59:33 +08:00
parent cbaef3bd59
commit 1751e48eaa

View File

@@ -350,16 +350,18 @@ func (scheduler *SchedulerFair) AcquireResource(job Job, task Task, nodes []Node
for i := range res.Status {
for j := range node.Status {
if res.Status[i].UUID == node.Status[j].UUID {
if node.Status[j].MemoryAllocated == 0 {
scheduler.UsingGPUMu.Lock()
scheduler.UsingGPU ++
scheduler.UsingGPUMu.Unlock()
}
node.Status[j].MemoryAllocated += task.MemoryGPU
res.Status[i].MemoryTotal = task.MemoryGPU
}
}
}
if allocationType == 2 {
scheduler.UsingGPUMu.Lock()
scheduler.UsingGPU += task.NumberGPU
scheduler.UsingGPUMu.Unlock()
log.Info(res.Status, " is using")
for _, t := range res.Status {
scheduler.Attach(t.UUID, job.Name)
}
}