Skip to content

Commit

Permalink
Parallelize pixelize_sph_kernel_* methods. Fixes yt-project#2682
Browse files Browse the repository at this point in the history
  • Loading branch information
Xarthisius committed Jun 24, 2020
1 parent b92a05d commit 2febb94
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions yt/utilities/lib/pixelization_routines.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,7 @@ def pixelize_sph_kernel_projection(
prefactor_j *= quantity_to_smooth[j] * _weight_field[j]

# found pixels we deposit on, loop through those pixels
for xi in range(x0, x1):
for xi in prange(x0, x1, schedule="static"):
# we use the centre of the pixel to calculate contribution
x = (xi + 0.5) * dx + x_min

Expand Down Expand Up @@ -1279,7 +1279,7 @@ def pixelize_sph_kernel_slice(

# Now we know which pixels to deposit onto for this particle,
# so loop over them and add this particle's contribution
for xi in range(x0, x1):
for xi in prange(x0, x1, schedule="static"):
x = (xi + 0.5) * dx + x_min

posx_diff = posx[j] - x
Expand Down Expand Up @@ -1371,7 +1371,7 @@ def pixelize_sph_kernel_arbitrary_grid(np.float64_t[:, :, :] buff,

# Now we know which voxels to deposit onto for this particle,
# so loop over them and add this particle's contribution
for xi in range(x0, x1):
for xi in prange(x0, x1, schedule="static"):
x = (xi + 0.5) * dx + x_min

posx_diff = posx[j] - x
Expand Down

0 comments on commit 2febb94

Please sign in to comment.