diff --git a/schedulers/bpMaxMinPistonCapping.go b/schedulers/bpMaxMinPistonCapping.go index ee05c3b..edc27d8 100644 --- a/schedulers/bpMaxMinPistonCapping.go +++ b/schedulers/bpMaxMinPistonCapping.go @@ -229,6 +229,12 @@ func (s *BPMaxMinPistonCapping) CheckFit(i int, (offerCPU >= (*totalCPU + task.CPU)) && (offerRAM >= (*totalRAM + task.RAM)) { + // Start piston capping if haven't started yet + if !s.isCapping { + s.isCapping = true + s.startCapping() + } + *totalWatts += task.Watts *totalCPU += task.CPU *totalRAM += task.RAM diff --git a/schedulers/bpswClassMapWattsPistonCapping.go b/schedulers/bpswClassMapWattsPistonCapping.go index 20c5e61..5079980 100644 --- a/schedulers/bpswClassMapWattsPistonCapping.go +++ b/schedulers/bpswClassMapWattsPistonCapping.go @@ -271,6 +271,12 @@ func (s *BPSWClassMapWattsPistonCapping) ResourceOffers(driver sched.SchedulerDr (offerCPU >= (totalCPU + task.CPU)) && (offerRAM >= (totalRAM + task.RAM)) { + // Start piston capping if haven't started yet + if !s.isCapping { + s.isCapping = true + s.startCapping() + } + fmt.Println("Watts being used: ", task.ClassToWatts[nodeClass]) taken = true totalWatts += task.ClassToWatts[nodeClass]