mirror of
https://github.com/newnius/YAO-scheduler.git
synced 2025-12-15 08:16:43 +00:00
update
This commit is contained in:
@@ -350,16 +350,18 @@ func (scheduler *SchedulerFair) AcquireResource(job Job, task Task, nodes []Node
|
|||||||
for i := range res.Status {
|
for i := range res.Status {
|
||||||
for j := range node.Status {
|
for j := range node.Status {
|
||||||
if res.Status[i].UUID == node.Status[j].UUID {
|
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
|
node.Status[j].MemoryAllocated += task.MemoryGPU
|
||||||
res.Status[i].MemoryTotal = task.MemoryGPU
|
res.Status[i].MemoryTotal = task.MemoryGPU
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if allocationType == 2 {
|
for _, t := range res.Status {
|
||||||
scheduler.UsingGPUMu.Lock()
|
scheduler.Attach(t.UUID, job.Name)
|
||||||
scheduler.UsingGPU += task.NumberGPU
|
|
||||||
scheduler.UsingGPUMu.Unlock()
|
|
||||||
log.Info(res.Status, " is using")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user