I have a code which given two parameters, (k, m) will return a 4d numpy array, my requirement is that I need to calculate this array for possible values of (k,m) with k,m < N and add them up. This is slow in serial so I am trying to learn the multiprocessing module in python to do it. https://docs.python.org/2/library/multiprocessing.html
Essentially I want to use my 8 cores to parallely compute these 4d arrays and add them all up. Now the question is how to design this. Each array can be around 100 MB and N around 20. So storing 20**2 * 100 MB in a queue is not possible. The solution would be to have a shared memory object, a result array which each process will keep adding the results into.
multiprocessing has two means for doing this, using shared memory or a server process. Neither of them seem to support mutlidim arrays. Can anyone suggest a way to implement my program? Thx in advance.