Commits

Anonymous committed 1f50d52

t script for sembench

  • Participants
  • Parent commits 67f8523

Comments (0)

Files changed (1)

File sembench/runtest.py

 import os, re, math
 from subprocess import *
 
-# corelist = [1]
-corelist = [1, 2, 3, 4, 5, 6, 7, 8]
+corelist = range(1, 5)
 repeat = 10
 
 log = open('stat.log', 'w')
 
 def warmup():
     print('Warming up...')
-    p = Popen('./sockbench 1', shell=True, stdout=PIPE)
+    p = Popen('./sembench 1', shell=True, stdout=PIPE)
     os.waitpid(p.pid, 0)
 
 def test():
     for n in corelist:
         stats = []
         for i in xrange(repeat):
-            p = Popen('./sockbench %d' % n, shell=True, stdout=PIPE)
+            p = Popen('./sembench %d' % n, shell=True, stdout=PIPE)
             os.waitpid(p.pid, 0)
             output = p.stdout.read().strip()
             usec = int(pattern.search(output).group(1))
             stats.append(usec)
             log.write('%d: %d\n' % (n, usec))
             print('%d: %d' % (n, usec))
-        print('Core #%d: averge %f, std deviation %f' % (n, avg(stats), stddev(stats)))
+        print('Core #%d: averge %.0f, std deviation%% %.2f' % (n, avg(stats), (stddev(stats) / avg(stats))))
 
 warmup()
 test()