I am very new to multi-threading and multi-processing and trying to make for loop parallel. I searched similar questions, and created code based on multiprocessing module.
p.map does the looping for you, so remove the for i in gn:.
p.map
for i in gn:
That is, p.map applies fun1 to each element of gen1, so gn is one of those elements.
fun1
gen1
gn