mirror of
https://github.com/newnius/YAO-scheduler.git
synced 2025-12-15 08:16:43 +00:00
update
This commit is contained in:
@@ -26,6 +26,8 @@ type ResourcePool struct {
|
||||
|
||||
counter int
|
||||
counterTotal int
|
||||
|
||||
bindings map[string]map[string]bool
|
||||
}
|
||||
|
||||
func (pool *ResourcePool) start() {
|
||||
@@ -34,6 +36,8 @@ func (pool *ResourcePool) start() {
|
||||
pool.networksFree = map[string]bool{}
|
||||
pool.versions = map[string]float64{}
|
||||
|
||||
pool.bindings = map[string]map[string]bool{}
|
||||
|
||||
/* check dead nodes */
|
||||
go func() {
|
||||
pool.heartBeat = map[string]time.Time{}
|
||||
@@ -112,6 +116,8 @@ func (pool *ResourcePool) update(node NodeStatus) {
|
||||
return
|
||||
}
|
||||
|
||||
log.Info(node.Version, "!=", pool.versions[node.ClientID])
|
||||
|
||||
pool.counter++
|
||||
status, ok := pool.nodes[node.ClientID]
|
||||
if ok {
|
||||
@@ -189,3 +195,15 @@ func (pool *ResourcePool) releaseNetwork(network string) {
|
||||
pool.networksFree[network] = true
|
||||
pool.networkMu.Unlock()
|
||||
}
|
||||
|
||||
func (pool *ResourcePool) attach(GPU string, job string) {
|
||||
if _, ok := pool.bindings[GPU]; ok {
|
||||
pool.bindings[GPU][job] = true
|
||||
}
|
||||
}
|
||||
|
||||
func (pool *ResourcePool) detach(GPU string, job string) {
|
||||
if list, ok := pool.bindings[GPU]; ok {
|
||||
delete(list, job)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user