So I am currently involved in a university project looking at thousands of samples of genetic data for cancer patients, might program was going to take too long to run so I used multiprocessing, it worked fine on an apple mac my friend borrowed me,but the moment I transferred it over to a university windows system it has failed and im unsure why the program doesn't work anymore.
I decided to strip my code as simply as possible to see the error,my program itself without the multiprocessing element to speed up the number of samples works fine. I believe the problem revolves around the code below. Instead of placing my very long program ive switched out it for a simple addition, and it still does not work, uses a very high cpu and I cannot see where I am going wrong. Kind Regards.
Expected result is instant 5,15,25,35 instantaneously, I have windows 10 on my computer Im currently using.
import multiprocessing
from multiprocessing import Pool
import collections
value=collections.namedtuple('value',['vectx','vecty'])
Values=(value(vectx=0,vecty=5),value(vectx=5,vecty=10),value(vectx=10,vecty=15),value(vectx=15,vecty=20))
print(1)
def Alter(x):
vectx=x.vectx
vecty=x.vecty
Z=(vectx+vecty)
return(Z)
if __name__ == '__main__':
with Pool(2) as p:
result=p.map(Alter, Values)
print(2)
new=[]
for i in result:
new.append(i)
print(new)