def compute(): for i in range(nhost): pc.submit(f, i) den = numpy.zeros(matrank) while(pc.working()): den += pc.pyret() return den
def f(ii): i = int(ii) density = numpy.zeros(matrank) for gid in range(i , params.Nmitral, nhost): m = mkmitral.mkmitral(gid) for sec in m.secdens: accumulate_density(sec, density, domain) print gid return density