Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
severinson committed Jun 22, 2023
1 parent 6e5d741 commit 3945a46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
9 changes: 0 additions & 9 deletions internal/scheduler/preempting_queue_scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1230,15 +1230,6 @@ func TestPreemptingQueueScheduler(t *testing.T) {
for queue, qctx := range sctx.QueueSchedulingContexts {
assert.True(t, qctx.AllocatedByPriorityClass.Equal(allocatedByQueueAndPriorityClass[queue]))
}
// for queue, allocated := range allocatedByQueueAndPriorityClass {
// // Filter out explicit zeros to enable comparing with expected allocation.
// allocatedByQueueAndPriorityClass[queue] = armadamaps.Filter(
// allocated,
// func(_ int32, rl schedulerobjects.ResourceList) bool {
// return !rl.IsZero()
// },
// )
// }

// Test that jobs are mapped to nodes correctly.
for _, job := range result.PreemptedJobs {
Expand Down
5 changes: 2 additions & 3 deletions internal/scheduler/scheduling_algo.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func (l *FairSchedulingAlgo) newFairSchedulingAlgoContext(ctx context.Context, t
}

// Used to calculate fair share.
totalAllocationByPoolAndQueue := l.totalAllocationByPoolAndQueue(executors, jobsByExecutorId)
totalAllocationByPoolAndQueue := l.aggregateAllocationByPoolAndQueueAndPriorityClass(executors, jobsByExecutorId)

// Filter out any executor that isn't acknowledging jobs in a timely fashion
// Note that we do this after aggregating allocation across clusters for fair share.
Expand Down Expand Up @@ -520,8 +520,7 @@ func (l *FairSchedulingAlgo) filterLaggingExecutors(
return activeExecutors
}

// TODO: Rename
func (l *FairSchedulingAlgo) totalAllocationByPoolAndQueue(executors []*schedulerobjects.Executor, jobsByExecutorId map[string][]*jobdb.Job) map[string]map[string]schedulerobjects.QuantityByTAndResourceType[string] {
func (l *FairSchedulingAlgo) aggregateAllocationByPoolAndQueueAndPriorityClass(executors []*schedulerobjects.Executor, jobsByExecutorId map[string][]*jobdb.Job) map[string]map[string]schedulerobjects.QuantityByTAndResourceType[string] {
rv := make(map[string]map[string]schedulerobjects.QuantityByTAndResourceType[string])
for _, executor := range executors {
allocationByQueue := rv[executor.Pool]
Expand Down

0 comments on commit 3945a46

Please sign in to comment.