From 5a6a43937ce769872434f7404fa546062e0fb1a0 Mon Sep 17 00:00:00 2001 From: Pradyumna Kaushik Date: Thu, 4 Oct 2018 20:10:46 -0400 Subject: [PATCH] Hi/Lo Thresholds only for extrema and prog-extrema. Added condition to mandate high and low thresholds only for extrema and progressive extrema power capping strategies. --- scheduler.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/scheduler.go b/scheduler.go index 1939ecc..fe81bc6 100644 --- a/scheduler.go +++ b/scheduler.go @@ -179,16 +179,20 @@ func main() { } else { if *powerCapPolicy == "extrema" { extrema = true - } else { + } else if *powerCapPolicy == "prog-extrema" { progExtrema = true } - // High and Low Thresholds. - // These values are not used to configure the scheduler. - // hiThreshold and loThreshold are passed to the powercappers. - if *hiThreshold < *loThreshold { - logger.WriteLog(elekLogDef.ERROR, "High threshold is of a"+ - " lower value than low threshold.") - os.Exit(1) + // High and Low thresholds are currently only needed for extrema and + // progressive extrema. + if extrema || progExtrema { + // High and Low Thresholds. + // These values are not used to configure the scheduler. + // hiThreshold and loThreshold are passed to the powercappers. + if *hiThreshold < *loThreshold { + logger.WriteLog(elekLogDef.ERROR, "High threshold is of a"+ + " lower value than low threshold.") + os.Exit(1) + } } } }