mirror of
https://github.com/newnius/YAO-scheduler.git
synced 2025-12-15 16:16:44 +00:00
update
This commit is contained in:
@@ -789,18 +789,16 @@ func (pool *ResourcePool) acquireResource(job Job) []NodeStatus {
|
|||||||
/* assign */
|
/* assign */
|
||||||
var ress []NodeStatus
|
var ress []NodeStatus
|
||||||
if len(candidates) > 0 {
|
if len(candidates) > 0 {
|
||||||
for range job.Tasks { //append would cause uncertain order
|
|
||||||
ress = append(ress, NodeStatus{ClientID: "null"})
|
|
||||||
}
|
|
||||||
|
|
||||||
var nodesT []NodeStatus
|
var nodesT []NodeStatus
|
||||||
for _, node := range candidates {
|
for _, node := range candidates {
|
||||||
nodesT = append(nodesT, node.Copy())
|
nodesT = append(nodesT, node.Copy())
|
||||||
}
|
}
|
||||||
|
|
||||||
allocation := fastBestFit(nodesT, job.Tasks)
|
allocation := fastBestFit(nodesT, job.Tasks)
|
||||||
if !allocation.Flags["valid"] {
|
if allocation.Flags["valid"] {
|
||||||
return []NodeStatus{}
|
|
||||||
|
for range job.Tasks { //append would cause uncertain order
|
||||||
|
ress = append(ress, NodeStatus{ClientID: "null"})
|
||||||
}
|
}
|
||||||
|
|
||||||
for nodeID, tasks := range allocation.TasksOnNode {
|
for nodeID, tasks := range allocation.TasksOnNode {
|
||||||
@@ -853,6 +851,7 @@ func (pool *ResourcePool) acquireResource(job Job) []NodeStatus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for segID, lock := range locks {
|
for segID, lock := range locks {
|
||||||
log.Debug("Unlock ", segID)
|
log.Debug("Unlock ", segID)
|
||||||
|
|||||||
Reference in New Issue
Block a user