1
0
mirror of https://github.com/newnius/YAO-scheduler.git synced 2025-12-15 08:16:43 +00:00

update shceduler_fair, bugfix

This commit is contained in:
2019-08-01 14:16:44 +08:00
parent cfad24d26c
commit 9d3489ae91
2 changed files with 6 additions and 4 deletions

View File

@@ -32,6 +32,7 @@ func (jm *JobManager) start() {
if len(resource.Status) > 0 { if len(resource.Status) > 0 {
break break
} }
time.Sleep(time.Second * 1)
} }
log.Info("Receive resource", resource) log.Info("Receive resource", resource)
jm.resources = append(jm.resources, resource) jm.resources = append(jm.resources, resource)

View File

@@ -179,6 +179,9 @@ func (scheduler *SchedulerFair) AcquireResource(job Job, task Task) NodeStatus {
} }
} }
go func(res NodeStatus) { go func(res NodeStatus) {
if len(res.Status) == 0 {
return
}
if _, ok := scheduler.resourceAllocations[job.Group]; !ok { if _, ok := scheduler.resourceAllocations[job.Group]; !ok {
scheduler.resourceAllocations[job.Group] = &ResourceCount{} scheduler.resourceAllocations[job.Group] = &ResourceCount{}
} }
@@ -189,10 +192,8 @@ func (scheduler *SchedulerFair) AcquireResource(job Job, task Task) NodeStatus {
cnt.NumberGPU ++ cnt.NumberGPU ++
cnt.MemoryGPU += v.MemoryTotal cnt.MemoryGPU += v.MemoryTotal
} }
log.Info(job.Group, cnt) scheduler.UpdateNextQueue()
if len(res.Status) != 0 {
scheduler.UpdateNextQueue()
}
}(res) }(res)
return res return res
} }