Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from fast_gossip import *
- from multiprocessing import Pool
- from itertools import product
- params = {
- 'L': 2,
- 'p': 2**10,
- 'f': 3,
- 'Tf': 15, #max(2 * (F + 2), 6)
- 'Ti': 20,
- 'Tg': 25,
- 'total_time': 1000,
- 'fcg_without_first': True,
- 'barrier_fcg': False
- }
- params['master_buffer_size'] = params['Tf']
- params['spread'] = 100
- params['online_failures'] = 0
- params['inactive_per'] = 0
- def f(run_ind):
- return run_one(params)
- n = 10
- fa = np.zeros(n)
- ca = np.zeros(n)
- ta = np.zeros(n)
- t0 = time()
- pool = Pool() #defaults to number of available CPU's
- chunksize = 20 #this may take some guessing ... take a look at the docs to decide
- for ind, res in enumerate(pool.imap(Fun, xrange(n))), chunksize):
- finish, errors, t = res
- fa[ind] = finish
- ca[ind] = errors
- ta[ind] = t
- print('time - ', (time()-t0), 'seconds')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement