1
0
mirror of https://github.com/newnius/YAO-scheduler.git synced 2025-12-12 23:36:44 +00:00
This commit is contained in:
2020-05-04 00:44:04 +08:00
parent f7077e9efd
commit be2840f861

View File

@@ -531,6 +531,16 @@ func (scheduler *SchedulerFair) AcquireResource(job Job, task Task, nodes []Node
lock.Unlock()
}
for cur := start; ; {
log.Info("trylock ", cur.ID)
cur.Lock.Lock()
cur.Lock.Unlock()
cur = cur.Next
if cur.ID == start.ID {
break
}
}
go func(res NodeStatus) {
if len(res.Status) == 0 {
return
@@ -741,7 +751,7 @@ func (scheduler *SchedulerFair) UpdateNextQueue() {
start := pool.pools[0].Next
for cur := start; ; {
log.Info(cur.ID)
//cur.Lock.Lock()
cur.Lock.Lock()
for _, node := range cur.Nodes {
CPU += float64(node.NumCPU)
Memory += float64(node.MemTotal)
@@ -750,7 +760,7 @@ func (scheduler *SchedulerFair) UpdateNextQueue() {
MemoryGPU += float64(card.MemoryTotal)
}
}
//cur.Lock.Unlock()
cur.Lock.Unlock()
cur = cur.Next
if cur == start {
break