mirror of
https://github.com/newnius/YAO-scheduler.git
synced 2025-06-06 22:01: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.resourcesMu.Lock()
|
||||
if jm.resources[i].ClientID != "_released_" {
|
||||
jm.scheduler.ReleaseResource(jm.job, jm.resources[i])
|
||||
log.Info("return resource ", jm.resources[i].ClientID)
|
||||
jm.resources[i].ClientID = "_released_"
|
||||
}
|
||||
|
||||
for _, t := range jm.resources[i].Status {
|
||||
InstanceOfResourcePool().detach(t.UUID, jm.job)
|
||||
}
|
||||
for _, t := range jm.resources[i].Status {
|
||||
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 {
|
||||
|
@ -908,7 +908,7 @@ func (pool *ResourcePool) releaseResource(job Job, agent NodeStatus) {
|
||||
node.Status[j].MemoryAllocated -= gpu.MemoryTotal
|
||||
if node.Status[j].MemoryAllocated < 0 {
|
||||
// in case of error
|
||||
log.Warn(node.ClientID, "More Memory Allocated")
|
||||
log.Warn(node.ClientID, " More Memory Allocated")
|
||||
node.Status[j].MemoryAllocated = 0
|
||||
}
|
||||
if node.Status[j].MemoryAllocated == 0 {
|
||||
|
@ -320,7 +320,7 @@ func (scheduler *SchedulerFair) UpdateQuota() {
|
||||
pool := InstanceOfResourcePool()
|
||||
|
||||
available := pool.TotalGPU - usingGPU - allocatedGPU
|
||||
if available == 0 {
|
||||
if available <= 0 {
|
||||
return
|
||||
}
|
||||
log.Info("Can allocate ", available)
|
||||
|
Loading…
Reference in New Issue
Block a user