import sys
import shelve


s = shelve.open(sys.argv[1])
d = dict(s)
s.close()

# {'count': 10000, 'extra': 256, 'receive': 1148.0290439128876, 'submit': 4.298105001449585, 'participants': 1, 'order': 5}
# 'tasks':  defaultdict(<type 'int'>, {'m5-2-1.local-31671': 10000}),

for line in (i[1] for i in sorted(d.iteritems(), key = lambda x: x[1]['stats']['participants'])):
  run = line['stats']

  velocity = run['count'] / run['receive']


  # speedup (http://en.wikipedia.org/wiki/Speedup):
  S_p = run['receive']/run['count'] / 1148.02904

  print run['participants'], velocity, S_p

