Skip to content

Commit abbfe88

Browse files
committed
add all AW resources for status dispatched
1 parent adbe374 commit abbfe88

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

pkg/controller/queuejob/queuejob_controller_ex.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -940,9 +940,16 @@ func (qjm *XController) getAggregatedAvailableResourcesPriority(unallocatedClust
940940
continue
941941
} else if value.Status.State == arbv1.AppWrapperStateEnqueued {
942942
// Don't count the resources that can run but not yet realized (job orchestration pending or partially running).
943-
944-
totalResource := qjm.addTotalSnapshotResourcesConsumedByAw(value.Status.TotalGPU, value.Status.TotalCPU, value.Status.TotalMemory)
945-
pending = pending.Add(totalResource)
943+
for _, resctrl := range qjm.qjobResControls {
944+
qjv := resctrl.GetAggregatedResources(value)
945+
pending = pending.Add(qjv)
946+
klog.V(10).Infof("[getAggAvaiResPri] Subtract all resources %+v in resctrlType=%T for job %s which can-run is set to: %v but state is still pending.", qjv, resctrl, value.Name, value.Status.CanRun)
947+
}
948+
for _, genericItem := range value.Spec.AggrResources.GenericItems {
949+
qjv, _ := genericresource.GetResources(&genericItem)
950+
pending = pending.Add(qjv)
951+
klog.V(10).Infof("[getAggAvaiResPri] Subtract all resources %+v in resctrlType=%T for job %s which can-run is set to: %v but state is still pending.", qjv, genericItem, value.Name, value.Status.CanRun)
952+
}
946953

947954
continue
948955
} else if value.Status.State == arbv1.AppWrapperStateActive {

0 commit comments

Comments
 (0)