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
c4b38c56ab
commit
e521ba4378
@ -121,3 +121,8 @@ GPU is occupied by which job(s)
|
|||||||
```
|
```
|
||||||
?action=debug_disable_mock
|
?action=debug_disable_mock
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**UpdateStrategy**
|
||||||
|
```
|
||||||
|
?aciotn=allocator_update_strategy&strategy=mixed
|
||||||
|
```
|
10
src/ga.go
10
src/ga.go
@ -81,6 +81,9 @@ func (X Allocation) Mutate(rng *rand.Rand) {
|
|||||||
/* random-fit */
|
/* random-fit */
|
||||||
for _, task := range tasks {
|
for _, task := range tasks {
|
||||||
if nodeID, ok := randomFit(X, task); ok {
|
if nodeID, ok := randomFit(X, task); ok {
|
||||||
|
if len(X.TasksOnNode[nodeID]) == 0 {
|
||||||
|
X.TasksOnNode[nodeID] = []Task{}
|
||||||
|
}
|
||||||
X.TasksOnNode[nodeID] = append(X.TasksOnNode[nodeID], task)
|
X.TasksOnNode[nodeID] = append(X.TasksOnNode[nodeID], task)
|
||||||
cnt := task.NumberGPU
|
cnt := task.NumberGPU
|
||||||
//log.Info("Add task ", task.Name, " in ", nodeID)
|
//log.Info("Add task ", task.Name, " in ", nodeID)
|
||||||
@ -187,7 +190,7 @@ func (X Allocation) Crossover(Y eaopt.Genome, rng *rand.Rand) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if cnt != 0 {
|
if cnt != 0 {
|
||||||
log.Warn("Cross remove ", cnt)
|
log.Warn("cross add, no enough GPU left on ", nodeID, ", still need", cnt)
|
||||||
}
|
}
|
||||||
//log.Info("After ", X.Nodes[nodeID].Status)
|
//log.Info("After ", X.Nodes[nodeID].Status)
|
||||||
//fmt.Println(X.TasksOnNode)
|
//fmt.Println(X.TasksOnNode)
|
||||||
@ -216,6 +219,9 @@ func (X Allocation) Crossover(Y eaopt.Genome, rng *rand.Rand) {
|
|||||||
/* random-fit */
|
/* random-fit */
|
||||||
for _, task := range tasks {
|
for _, task := range tasks {
|
||||||
if nodeID, ok := randomFit(X, task); ok {
|
if nodeID, ok := randomFit(X, task); ok {
|
||||||
|
if len(X.TasksOnNode[nodeID]) == 0 {
|
||||||
|
X.TasksOnNode[nodeID] = []Task{}
|
||||||
|
}
|
||||||
X.TasksOnNode[nodeID] = append(X.TasksOnNode[nodeID], task)
|
X.TasksOnNode[nodeID] = append(X.TasksOnNode[nodeID], task)
|
||||||
cnt := task.NumberGPU
|
cnt := task.NumberGPU
|
||||||
//log.Info("Remove task ", task.Name, " in ", nodeID)
|
//log.Info("Remove task ", task.Name, " in ", nodeID)
|
||||||
@ -231,7 +237,7 @@ func (X Allocation) Crossover(Y eaopt.Genome, rng *rand.Rand) {
|
|||||||
}
|
}
|
||||||
//log.Info("After ", X.Nodes[nodeID].Status)
|
//log.Info("After ", X.Nodes[nodeID].Status)
|
||||||
if cnt != 0 {
|
if cnt != 0 {
|
||||||
log.Warn("cross add", cnt)
|
log.Warn("cross add, no enough GPU left on ", nodeID, ", still need", cnt)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
X.Flags["valid"] = false
|
X.Flags["valid"] = false
|
||||||
|
Loading…
Reference in New Issue
Block a user