mirror of
https://github.com/newnius/YAO-scheduler.git
synced 2025-06-07 14:21:55 +00:00
update
This commit is contained in:
parent
d1235d8a73
commit
beab442f36
@ -923,13 +923,11 @@ func (pool *ResourcePool) doAcquireResource(job Job) []NodeStatus {
|
|||||||
allocation := InstanceOfAllocator().allocate(nodesT, tasks)
|
allocation := InstanceOfAllocator().allocate(nodesT, tasks)
|
||||||
//log.Info(allocation)
|
//log.Info(allocation)
|
||||||
if allocation.Flags["valid"] {
|
if allocation.Flags["valid"] {
|
||||||
|
|
||||||
log.Info(allocation.TasksOnNode)
|
|
||||||
|
|
||||||
for range job.Tasks { //append would cause uncertain order
|
for range job.Tasks { //append would cause uncertain order
|
||||||
ress = append(ress, NodeStatus{ClientID: "null"})
|
ress = append(ress, NodeStatus{ClientID: "null"})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cnt := 0
|
||||||
for nodeID, tasks := range allocation.TasksOnNode {
|
for nodeID, tasks := range allocation.TasksOnNode {
|
||||||
var node *NodeStatus
|
var node *NodeStatus
|
||||||
for i := range candidates {
|
for i := range candidates {
|
||||||
@ -945,6 +943,7 @@ func (pool *ResourcePool) doAcquireResource(job Job) []NodeStatus {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, task := range tasks {
|
for _, task := range tasks {
|
||||||
|
cnt++
|
||||||
res := NodeStatus{}
|
res := NodeStatus{}
|
||||||
res.ClientID = node.ClientID
|
res.ClientID = node.ClientID
|
||||||
res.ClientHost = node.ClientHost
|
res.ClientHost = node.ClientHost
|
||||||
@ -985,6 +984,11 @@ func (pool *ResourcePool) doAcquireResource(job Job) []NodeStatus {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if cnt != len(job.Tasks) {
|
||||||
|
log.Warn("Allocation is invalid")
|
||||||
|
log.Warn(cnt, job.Tasks, allocation.TasksOnNode)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user