1
0
mirror of https://github.com/newnius/YAO-scheduler.git synced 2025-12-13 07:46:43 +00:00
This commit is contained in:
2020-04-30 14:23:21 +08:00
parent fdec61cb30
commit 143490e4d4

View File

@@ -188,6 +188,7 @@ func (scheduler *SchedulerFair) AcquireResource(job Job, task Task) NodeStatus {
var candidates []NodeStatus
/* first round, find vacant gpu */
for i := 0; i < pool.poolsCount; i++ {
log.Info("lock,", (i+poolID)%pool.poolsCount)
pool.poolsMu[(i+poolID)%pool.poolsCount].Lock()
locks[(i+poolID)%pool.poolsCount] = pool.poolsMu[(i+poolID)%pool.poolsCount]
for _, node := range pool.pools[(i+poolID)%pool.poolsCount] {
@@ -286,6 +287,7 @@ func (scheduler *SchedulerFair) AcquireResource(job Job, task Task) NodeStatus {
}
for _, lock := range locks {
log.Info("unlock ", lock)
lock.Unlock()
}
go func(res NodeStatus) {