1
0
mirror of https://github.com/newnius/YAO-scheduler.git synced 2025-06-06 22:01:55 +00:00
This commit is contained in:
Newnius 2020-06-15 14:38:31 +08:00
parent d1235d8a73
commit beab442f36

View File

@ -923,13 +923,11 @@ func (pool *ResourcePool) doAcquireResource(job Job) []NodeStatus {
allocation := InstanceOfAllocator().allocate(nodesT, tasks)
//log.Info(allocation)
if allocation.Flags["valid"] {
log.Info(allocation.TasksOnNode)
for range job.Tasks { //append would cause uncertain order
ress = append(ress, NodeStatus{ClientID: "null"})
}
cnt := 0
for nodeID, tasks := range allocation.TasksOnNode {
var node *NodeStatus
for i := range candidates {
@ -945,6 +943,7 @@ func (pool *ResourcePool) doAcquireResource(job Job) []NodeStatus {
}
}
for _, task := range tasks {
cnt++
res := NodeStatus{}
res.ClientID = node.ClientID
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)
}
}
}