mirror of
https://github.com/newnius/YAO-scheduler.git
synced 2025-12-15 08:16:43 +00:00
update
This commit is contained in:
@@ -531,6 +531,16 @@ func (scheduler *SchedulerFair) AcquireResource(job Job, task Task, nodes []Node
|
|||||||
lock.Unlock()
|
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) {
|
go func(res NodeStatus) {
|
||||||
if len(res.Status) == 0 {
|
if len(res.Status) == 0 {
|
||||||
return
|
return
|
||||||
@@ -741,7 +751,7 @@ func (scheduler *SchedulerFair) UpdateNextQueue() {
|
|||||||
start := pool.pools[0].Next
|
start := pool.pools[0].Next
|
||||||
for cur := start; ; {
|
for cur := start; ; {
|
||||||
log.Info(cur.ID)
|
log.Info(cur.ID)
|
||||||
//cur.Lock.Lock()
|
cur.Lock.Lock()
|
||||||
for _, node := range cur.Nodes {
|
for _, node := range cur.Nodes {
|
||||||
CPU += float64(node.NumCPU)
|
CPU += float64(node.NumCPU)
|
||||||
Memory += float64(node.MemTotal)
|
Memory += float64(node.MemTotal)
|
||||||
@@ -750,7 +760,7 @@ func (scheduler *SchedulerFair) UpdateNextQueue() {
|
|||||||
MemoryGPU += float64(card.MemoryTotal)
|
MemoryGPU += float64(card.MemoryTotal)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//cur.Lock.Unlock()
|
cur.Lock.Unlock()
|
||||||
cur = cur.Next
|
cur = cur.Next
|
||||||
if cur == start {
|
if cur == start {
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user