mirror of
https://github.com/newnius/YAO-scheduler.git
synced 2025-12-13 07:46:43 +00:00
update
This commit is contained in:
@@ -57,8 +57,8 @@ func firstFit(allocation Allocation, task Task) (string, bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func fastBestFit(nodes []NodeStatus, tasks []Task) Allocation {
|
func fastBestFit(nodes []NodeStatus, tasks []Task) Allocation {
|
||||||
//log.Info(nodes)
|
log.Info(nodes)
|
||||||
//log.Info(tasks)
|
log.Info(tasks)
|
||||||
eva := Evaluator{}
|
eva := Evaluator{}
|
||||||
eva.init(nodes, tasks)
|
eva.init(nodes, tasks)
|
||||||
|
|
||||||
|
|||||||
@@ -11,20 +11,20 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TgenerateCase() ([]NodeStatus, []Task) {
|
func TgenerateCase() ([]NodeStatus, []Task) {
|
||||||
numTask := 6
|
numTask := 2
|
||||||
|
|
||||||
var nodes []NodeStatus
|
var nodes []NodeStatus
|
||||||
var tasks []Task
|
var tasks []Task
|
||||||
|
|
||||||
for i := 0; i < numTask*3; i++ {
|
for i := 0; i < numTask; i++ {
|
||||||
node := NodeStatus{ClientID: strconv.Itoa(i), Rack: "Rack-" + strconv.Itoa(i%40), Domain: "Domain-" + strconv.Itoa(i%4)}
|
node := NodeStatus{ClientID: strconv.Itoa(i), Rack: "Rack-" + strconv.Itoa(i%40), Domain: "Domain-" + strconv.Itoa(i%4)}
|
||||||
node.NumCPU = 24
|
node.NumCPU = 24
|
||||||
node.UtilCPU = 2.0
|
node.UtilCPU = 2.0
|
||||||
node.MemTotal = 188
|
node.MemTotal = 188
|
||||||
node.MemAvailable = 20
|
node.MemAvailable = 20
|
||||||
node.TotalBW = 100
|
node.TotalBW = 100
|
||||||
//cnt := 4
|
cnt := 1
|
||||||
cnt := rand.Intn(3) + 1
|
//cnt := rand.Intn(3) + 1
|
||||||
for i := 0; i < cnt; i++ {
|
for i := 0; i < cnt; i++ {
|
||||||
node.Status = append(node.Status, GPUStatus{MemoryTotal: 11439, MemoryAllocated: 0, UUID: node.ClientID + "-" + strconv.Itoa(i)})
|
node.Status = append(node.Status, GPUStatus{MemoryTotal: 11439, MemoryAllocated: 0, UUID: node.ClientID + "-" + strconv.Itoa(i)})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user