1
0
mirror of https://github.com/newnius/YAO-scheduler.git synced 2025-12-15 08:16:43 +00:00
This commit is contained in:
2020-04-30 17:52:52 +08:00
parent bbfd95f922
commit c447a85471
7 changed files with 152 additions and 33 deletions

View File

@@ -35,6 +35,8 @@ type ResourcePool struct {
bindings map[string]map[string]bool
bindingsMu sync.Mutex
utils map[string][]int
TotalGPU int
}
func (pool *ResourcePool) GPUModelToPower(model string) int {
@@ -60,6 +62,8 @@ func (pool *ResourcePool) start() {
pool.bindings = map[string]map[string]bool{}
pool.utils = map[string][]int{}
pool.TotalGPU = 0
pool.poolsCount = 100
for i := 0; i < pool.poolsCount; i++ {
pool.pools = append(pool.pools, map[string]NodeStatus{})
@@ -141,6 +145,8 @@ func (pool *ResourcePool) start() {
if len(pool.history) > 60 {
pool.history = pool.history[len(pool.history)-60:]
}
pool.TotalGPU = TotalGPU
time.Sleep(time.Second * 60)
}
}()