Changing "global" array with pool processes
<p>Apologies first for the small code dump to follow, but I've spent the evening taking my first baby steps into the multiprocessing module; with my previous knowledge coming from openMPI fortran. I'm having issues with the below code in that although all the threads spawn and run etc and have access to all the correct values (both global and local) the changes each inacts upon the numpy points array do not remain. I have tried both setting the array as "global" as well as segregating into a separate class to access it both to no avail. I guess I'm missing some fundamental understanding.</p>

<p>Important parts:</p>

<pre><code>points = np.ones( N )

def explore(pos,rad):
    #find range of points for comparison
    low = []
    high = []
    for dim in pos:
        low.append( int( floor( (dim - rad - 0.5*radius) / radius ) ) )
        high.append( int( ceil( (dim + rad + 0.5*radius) / radius ) ) )

    #check for overlap
    for x in xrange(low[0],high[0]+1):
        for y in xrange(low[1],high[1]+1):
            for z in xrange(low[2],high[2]+1):
                if points[x%N[0],y%N[1],z%N[2]]:
                    point = (x*radius,y*radius,z*radius)
                    distance = (point[0]-pos[0])**2 + (point[1]-pos[1])**2 + (point[2]-pos[2])**2 
                    if distance &lt;= (rad+(0.5*radius))**2:
                        points[x%N[0],y%N[1],z%N[2]] = 0
    return

pool = Pool()
for i in xrange( atoms ):
    pos = ...
    rad = ...
    pool.apply_async(explore,(pos,rad,))
pool.close()
pool.join()  
</code></pre>
