mirror of
https://github.com/newnius/YAO-scheduler.git
synced 2025-12-15 08:16:43 +00:00
update fair
This commit is contained in:
@@ -30,6 +30,10 @@ type SchedulerFair struct {
|
|||||||
|
|
||||||
allocatingGPU int
|
allocatingGPU int
|
||||||
allocatingGPUMu sync.Mutex
|
allocatingGPUMu sync.Mutex
|
||||||
|
|
||||||
|
totalQuota ResourceCount
|
||||||
|
allocatedQuota ResourceCount
|
||||||
|
quotaMu sync.Mutex
|
||||||
}
|
}
|
||||||
|
|
||||||
func (scheduler *SchedulerFair) Start() {
|
func (scheduler *SchedulerFair) Start() {
|
||||||
@@ -301,7 +305,21 @@ func (scheduler *SchedulerFair) UpdateQuota() {
|
|||||||
defer scheduler.queuesMu.Unlock()
|
defer scheduler.queuesMu.Unlock()
|
||||||
scheduler.queuesQuotaMu.Lock()
|
scheduler.queuesQuotaMu.Lock()
|
||||||
defer scheduler.queuesQuotaMu.Unlock()
|
defer scheduler.queuesQuotaMu.Unlock()
|
||||||
|
scheduler.quotaMu.Lock()
|
||||||
|
defer scheduler.quotaMu.Unlock()
|
||||||
log.Info("Updating queues quota~")
|
log.Info("Updating queues quota~")
|
||||||
|
|
||||||
|
usingGPU := 0
|
||||||
|
scheduler.resourceAllocationsMu.Lock()
|
||||||
|
for _, queue := range scheduler.resourceAllocations {
|
||||||
|
usingGPU += queue.NumberGPU
|
||||||
|
}
|
||||||
|
scheduler.resourceAllocationsMu.Unlock()
|
||||||
|
|
||||||
|
pool := InstanceOfResourcePool()
|
||||||
|
|
||||||
|
available := pool.TotalGPU - usingGPU
|
||||||
|
log.Info("Can allocate ", available)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (scheduler *SchedulerFair) QueryState(jobName string) MsgJobStatus {
|
func (scheduler *SchedulerFair) QueryState(jobName string) MsgJobStatus {
|
||||||
|
|||||||
Reference in New Issue
Block a user