Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. from fast_gossip import *
  2. from multiprocessing import Pool
  3. from itertools import product
  4.  
  5.  
  6. params = {
  7. 'L': 2,
  8. 'p': 2**10,
  9. 'f': 3,
  10. 'Tf': 15, #max(2 * (F + 2), 6)
  11. 'Ti': 20,
  12. 'Tg': 25,
  13. 'total_time': 1000,
  14. 'fcg_without_first': True,
  15. 'barrier_fcg': False
  16. }
  17. params['master_buffer_size'] = params['Tf']
  18.  
  19. params['spread'] = 100
  20. params['online_failures'] = 0
  21. params['inactive_per'] = 0
  22.  
  23. def f(run_ind):
  24. return run_one(params)
  25.  
  26. n = 10
  27. fa = np.zeros(n)
  28. ca = np.zeros(n)
  29. ta = np.zeros(n)
  30. t0 = time()
  31.  
  32. pool = Pool() #defaults to number of available CPU's
  33. chunksize = 20 #this may take some guessing ... take a look at the docs to decide
  34. for ind, res in enumerate(pool.imap(Fun, xrange(n))), chunksize):
  35. finish, errors, t = res
  36. fa[ind] = finish
  37. ca[ind] = errors
  38. ta[ind] = t
  39.  
  40. print('time - ', (time()-t0), 'seconds')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement