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 14:04:40 +08:00
parent 875e4665be
commit dbd880c971
4 changed files with 98 additions and 20 deletions

View File

@@ -37,6 +37,14 @@ type ResourcePool struct {
utils map[string][]int
}
func (pool *ResourcePool) GPUModelToPower(model string) int {
mapper := map[string]int{"k40": 1, "K80": 2, "P100": 3}
if power, err := mapper[model]; !err {
return power
}
return 0
}
func (pool *ResourcePool) getNodePool(name string) int {
h := fnv.New32a()
h.Write([]byte(name))