mirror of
https://github.com/newnius/YAO-scheduler.git
synced 2025-06-07 14:21:55 +00:00
update fair
This commit is contained in:
parent
d16df29b50
commit
c044d43490
@ -197,17 +197,20 @@ func (jm *JobManager) checkStatus(status []TaskStatus) {
|
|||||||
jm.scheduler.UpdateProgress(jm.job, Failed)
|
jm.scheduler.UpdateProgress(jm.job, Failed)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jm.resourcesMu.Lock()
|
||||||
if jm.resources[i].ClientID != "_released_" {
|
if jm.resources[i].ClientID != "_released_" {
|
||||||
jm.scheduler.ReleaseResource(jm.job, jm.resources[i])
|
jm.scheduler.ReleaseResource(jm.job, jm.resources[i])
|
||||||
log.Info("return resource ", jm.resources[i].ClientID)
|
log.Info("return resource ", jm.resources[i].ClientID)
|
||||||
jm.resources[i].ClientID = "_released_"
|
jm.resources[i].ClientID = "_released_"
|
||||||
}
|
|
||||||
|
|
||||||
for _, t := range jm.resources[i].Status {
|
for _, t := range jm.resources[i].Status {
|
||||||
InstanceOfResourcePool().detach(t.UUID, jm.job)
|
InstanceOfResourcePool().detach(t.UUID, jm.job)
|
||||||
}
|
}
|
||||||
|
|
||||||
InstanceJobHistoryLogger().submitTaskStatus(jm.job.Name, status[i])
|
jm.resourcesMu.Unlock()
|
||||||
|
|
||||||
|
InstanceJobHistoryLogger().submitTaskStatus(jm.job.Name, status[i])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if flagRunning && onlyPS && !jm.killFlag {
|
if flagRunning && onlyPS && !jm.killFlag {
|
||||||
|
@ -908,7 +908,7 @@ func (pool *ResourcePool) releaseResource(job Job, agent NodeStatus) {
|
|||||||
node.Status[j].MemoryAllocated -= gpu.MemoryTotal
|
node.Status[j].MemoryAllocated -= gpu.MemoryTotal
|
||||||
if node.Status[j].MemoryAllocated < 0 {
|
if node.Status[j].MemoryAllocated < 0 {
|
||||||
// in case of error
|
// in case of error
|
||||||
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 {
|
if node.Status[j].MemoryAllocated == 0 {
|
||||||
|
@ -320,7 +320,7 @@ func (scheduler *SchedulerFair) UpdateQuota() {
|
|||||||
pool := InstanceOfResourcePool()
|
pool := InstanceOfResourcePool()
|
||||||
|
|
||||||
available := pool.TotalGPU - usingGPU - allocatedGPU
|
available := pool.TotalGPU - usingGPU - allocatedGPU
|
||||||
if available == 0 {
|
if available <= 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.Info("Can allocate ", available)
|
log.Info("Can allocate ", available)
|
||||||
|
Loading…
Reference in New Issue
Block a user