mirror of
https://github.com/newnius/YAO-scheduler.git
synced 2025-06-07 14:21:55 +00:00
update fair
This commit is contained in:
parent
890982456b
commit
87211ef66b
@ -16,6 +16,7 @@ type SchedulerFair struct {
|
|||||||
queues map[string][]Job
|
queues map[string][]Job
|
||||||
queuesMu sync.Mutex
|
queuesMu sync.Mutex
|
||||||
|
|
||||||
|
drfyarn bool
|
||||||
enableBorrow bool
|
enableBorrow bool
|
||||||
IOUs map[string]map[string]*ResourceCount
|
IOUs map[string]map[string]*ResourceCount
|
||||||
queuesQuota map[string]*ResourceCount
|
queuesQuota map[string]*ResourceCount
|
||||||
@ -41,7 +42,8 @@ func (scheduler *SchedulerFair) Start() {
|
|||||||
scheduler.history = []*Job{}
|
scheduler.history = []*Job{}
|
||||||
scheduler.queues = map[string][]Job{}
|
scheduler.queues = map[string][]Job{}
|
||||||
scheduler.queues["default"] = []Job{}
|
scheduler.queues["default"] = []Job{}
|
||||||
scheduler.enableBorrow = true
|
scheduler.drfyarn = true
|
||||||
|
scheduler.enableBorrow = false
|
||||||
scheduler.IOUs = map[string]map[string]*ResourceCount{}
|
scheduler.IOUs = map[string]map[string]*ResourceCount{}
|
||||||
scheduler.queuesQuota = map[string]*ResourceCount{}
|
scheduler.queuesQuota = map[string]*ResourceCount{}
|
||||||
scheduler.resourceAllocations = map[string]*ResourceCount{}
|
scheduler.resourceAllocations = map[string]*ResourceCount{}
|
||||||
@ -212,6 +214,19 @@ func (scheduler *SchedulerFair) Start() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* drf of yarn/kube-batch */
|
||||||
|
if bestQueue == "" && scheduler.drfyarn {
|
||||||
|
least := math.MaxInt32
|
||||||
|
for queue, allocate := range scheduler.resourceAllocations {
|
||||||
|
if jobs, ok := scheduler.queues[queue]; ok && len(jobs) > 0 {
|
||||||
|
if bestQueue == "" || allocate.NumberGPU < least {
|
||||||
|
bestQueue = queue
|
||||||
|
least = allocate.NumberGPU
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* launch that job */
|
/* launch that job */
|
||||||
if bestQueue != "" {
|
if bestQueue != "" {
|
||||||
numberGPUtmp := 0
|
numberGPUtmp := 0
|
||||||
|
Loading…
Reference in New Issue
Block a user