Author: gnichols
Date: 2011-10-04 19:16:34 +0000 (Tue, 04 Oct 2011)
New Revision: 1108
Modified:
trunk/tests/cpuscaling/cpuscaling.py
Log:
741165 - cpuscaling TraceBack: TypeError: int argument required
Modified: trunk/tests/cpuscaling/cpuscaling.py
===================================================================
--- trunk/tests/cpuscaling/cpuscaling.py 2011-10-04 15:46:37 UTC (rev 1107)
+++ trunk/tests/cpuscaling/cpuscaling.py 2011-10-04 19:16:34 UTC (rev 1108)
@@ -169,6 +169,10 @@
return int(freq1) + self.frequencyTolerance*1000 > int(freq2)
def checkSpeedup(self, speedup, warn=False, maximumLimit=True):
+ if not self.predictedSpeedup:
+ self.logWorkloadError("Error: could not predict speedup, unable to evaluate measured speedup")
+ return False
+
message = None
tag = "Error:"
if warn:
@@ -697,6 +701,15 @@
minimumFrequency = self.getPackageParameter("scaling_min_freq")
if not minimumFrequency or not currentFrequency or not self.checkFrequency(minimumFrequency, currentFrequency):
print "Warning: Could not verify that cpu frequency is set to the minimum value of %s" % minimumFrequency
+ # calculate predicted speedup for the package
+ maximumFrequency = self.getPackageParameter("scaling_max_freq")
+ try:
+ self.predictedSpeedup = float(maximumFrequency)/float(minimumFrequency)
+ except Exception, e:
+ print "Error: could not determine predicted speedup"
+ print e
+ self.predictedSpeedup = None
+ success = False
# 9. Run and time non-cacheable work(?) test for each CPU
# 10. Repeat and time until execution times are within self.retryTolerance of each other
@@ -719,14 +732,6 @@
self.currentWorkload = "maximum"
currentFrequency = self.getFrequency()
- maximumFrequency = self.getPackageParameter("scaling_max_freq")
- try:
- self.predictedSpeedup = float(maximumFrequency)/float(minimumFrequency)
- except Exception, e:
- print "Error: could not determine predicted speedup"
- print e
- return False
-
if not maximumFrequency or not currentFrequency or not self.checkFrequency(maximumFrequency, currentFrequency):
print "Warning: Could not verify that cpu frequency is set to the maximum value of %s" % maximumFrequency
@@ -933,9 +938,11 @@
self.dumpTables()
if self.effectiveFrequencySupport:
- self.printFreqSummary("CPU Effective Frequency", package, self.workloadEffectiveFreq)
+ freqTable = self.workloadEffectiveFreq
+ self.printFreqSummary("CPU Effective Frequency", package, freqTable)
else:
- self.printFreqSummary("CPU Frequency Test (No Effective Frequency Support)", package, self.workloadFreq)
+ freqTable = self.workloadFreq
+ self.printFreqSummary("CPU Frequency Test (No Effective Frequency Support)", package, freqTable)
if "ondemand" in self.workloadTime:
@@ -953,7 +960,7 @@
if workloadTime:
sys.stdout.write("cpu %-3s " % cpu)
sys.stdout.write(" %.2f" % self.speedup(cpu, workload))
- sys.stdout.write((" (%4uMHz, %.2fs) " % (self.getWorkloadFreq(self.workloadEffectiveFreq, workload, cpu) ,workloadTime)[:10]))
+ sys.stdout.write((" (%4uMHz, %.2fs) " % (self.getWorkloadFreq(freqTable, workload, cpu) ,workloadTime)[:10]))
print ""
print ""