So I had the following code which works fine:
from concurrent.futures import ProcessPoolExecutor
import itertools
def grid_search_helper(vec_input):
v1 = vec_input[0]
v2 = vec_input[1]
v3 = vec_input[2]
d = {'v1' : v1, 'v2' : v2, 'v3' : v3}
return(d)
idx = range(0,10)
cutoff = np.ndarray.tolist(np.arange(0.6,0.95,0.05))
opt = [2]
iters = itertools.product(idx, cutoff, opt)
with ProcessPoolExecutor(max_workers = 11) as executor:
for res in executor.map(grid_search_helper,iters):
print(res)
Then I tried zip() to print the iterable that ProcessPoolExecuter is working on, however nothing is printed when I run the following code:
from concurrent.futures import ProcessPoolExecutor
import itertools
def grid_search_helper(vec_input):
v1 = vec_input[0]
v2 = vec_input[1]
v3 = vec_input[2]
d = {'v1' : v1, 'v2' : v2, 'v3' : v3}
return(d)
idx = range(0,10)
cutoff = np.ndarray.tolist(np.arange(0.6,0.95,0.05))
opt = [2]
iters = itertools.product(idx, cutoff, opt)
with ProcessPoolExecutor(max_workers = 11) as executor:
for res, itr in zip(executor.map(grid_search_helper,iters), iters):
print(res, itr)
I cannot figure out why. Can anybody help?