What am I doing wrong in the following code?
import multiprocessing as mp
from multiprocessing import Process
import numpy as np
def fun(X):
return X;
def funct(p,i):
print 'Hey'
res = [p.map(fun,range(2))];
return res;
if __name__ == '__main__':
pool = mp.Pool(2);
output = mp.Queue();
proc = [mp.Process(target = funct,args=(pool,i)) for i in range(2)]
for p in proc:
p.start()
for p in proc:
p.join()
results = [output.get() for p in proc]
print results
The program doesn't run after launching the process.