Skip to content

Commit

Permalink
enhancement: don't need to re-calculate job's allocated resource
Browse files Browse the repository at this point in the history
Signed-off-by: lowang-bh <[email protected]>
  • Loading branch information
lowang-bh committed Aug 17, 2023
1 parent 890d8a1 commit 7a0c6c0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions pkg/scheduler/plugins/overcommit/overcommit.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ func (op *overcommitPlugin) OnSessionOpen(ssn *framework.Session) {
if job.PodGroup.Status.Phase == scheduling.PodGroupRunning &&
job.PodGroup.Spec.MinResources != nil &&
int32(util.CalculateAllocatedTaskNum(job)) >= job.PodGroup.Spec.MinMember {
allocated := util.GetAllocatedResource(job)
inqueued := util.GetInqueueResource(job, allocated)
inqueued := util.GetInqueueResource(job, job.Allocated)
op.inqueueResource.Add(inqueued)
}
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/scheduler/plugins/proportion/proportion.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ func (pp *proportionPlugin) OnSessionOpen(ssn *framework.Session) {
if job.PodGroup.Status.Phase == scheduling.PodGroupRunning &&
job.PodGroup.Spec.MinResources != nil &&
int32(util.CalculateAllocatedTaskNum(job)) >= job.PodGroup.Spec.MinMember {
allocated := util.GetAllocatedResource(job)
inqueued := util.GetInqueueResource(job, allocated)
inqueued := util.GetInqueueResource(job, job.Allocated)
attr.inqueue.Add(inqueued)
}
attr.elastic.Add(job.GetElasticResources())
Expand Down

0 comments on commit 7a0c6c0

Please sign in to comment.