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:
@@ -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)
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user