コード例 #1
0
ファイル: CompModelTest.py プロジェクト: willmore/D2C
 def testPolyCompModel2Simple(self):
     points = [SimpleDataPoint(cpuCount=1, cpu=1, time=1000, probSize=35, totalMemory=100), 
               SimpleDataPoint(cpuCount=2, cpu=2, time=300, probSize=35, totalMemory=100), 
               SimpleDataPoint(cpuCount=1, cpu=1, time=2000, probSize=70, totalMemory=100)]
     
     model = GustafsonCompModel(dataPoints=points, scaleFunction='linear')
     
     self.assertAlmostEquals(1.66666666, model.speedUpFunc(2))
     
     self.assertAlmostEquals(1000, model.time_1_func(35))
     self.assertAlmostEquals(2000, model.time_1_func(70))
コード例 #2
0
ファイル: CompModelTest.py プロジェクト: willmore/D2C
 def testPolyCompModel2Simple2(self):
     points = [SimpleDataPoint(cpuCount=1, cpu=1, time=1100, probSize=35, totalMemory=100), 
               SimpleDataPoint(cpuCount=2, cpu=2, time=300, probSize=35, totalMemory=100), 
               SimpleDataPoint(cpuCount=1, cpu=1, time=2000, probSize=70, totalMemory=100),
               SimpleDataPoint(cpuCount=1, cpu=1, time=3100, probSize=105, totalMemory=100)]
     
     model = GustafsonCompModel(dataPoints=points, scaleFunction='linear')
     
     ''' Assert speed up func matches observation '''
     self.assertAlmostEquals(1.83333333, model.speedUpFunc(2))
     
     ''' Assert speed up func matches expectation'''
     self.assertAlmostEquals(2.666666666, model.speedUpFunc(3))
     
     
     
     ''' Test that the single proc line fits between the observations '''
     self.assertAlmostEquals(1066.66666666, model.time_1_func(35))
     self.assertAlmostEquals(2066.66666666, model.time_1_func(70))
     self.assertAlmostEquals(3066.66666666, model.time_1_func(105))
     
     self.assertAlmostEquals(400.0000, model.modelFunc(probSize=35, cpu=1, count=3))