Bug fix to start capping when the first task fits an offer.
This commit is contained in:
parent
2744bbe0f4
commit
f46cd32869
2 changed files with 12 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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]
|
||||
|
|
Reference in a new issue