I'm trying to parallelize a for loop in python. I get a memory error in the permutations phase of the parameters.
I can see why this might fail, but what is the other way to do the same thing.
import itertools
import multiprocessing
LOAD_GEN_KEYS = range(138259)
ES_DATA_K = range(9606834)
paramlist = list(itertools.product(LOAD_GEN_KEYS, ES_DATA_K))
pool = multiprocessing.Pool()
VALID_TS = pool.map(curate_results, paramlist)
def curate_results(params):
LG = params[0]
ES = params[1]
ES_S = str(int(ES)/1000)
if ES_S == LG:
return [LG, ES]
else:
return []
Any help will be appreciated.