Reactivate parallel for sphrical projection, add some auxiliary attribute in ctpv.

This commit is contained in:
Guilhem Lavaux 2018-05-10 15:31:48 +02:00
parent 897427436e
commit 18c81baac9
2 changed files with 13 additions and 4 deletions

View file

@ -874,11 +874,11 @@ def spherical_projection(int Nside,
job_done = view.array(shape=(N,), format="i", itemsize=sizeof(int))
job_done[:] = 0
theta,phi = hp.pix2ang(Nside, np.arange(N0))
if True:#nogil, parallel():
with nogil, parallel():
tid = smp_get_thread_id()
for i in range(N0):#prange(N0,schedule='dynamic',chunksize=256):
for i in prange(N0,schedule='dynamic',chunksize=256):
if progress != 0 and (i%booster) == 0:
# with gil:
with gil:
p.update(_mysum(job_done))
outm[i] = _spherical_projloop(theta[i], phi[i], density_view, min_distance, max_distance, shifter, integrator_id)
job_done[tid] += 1