Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for unyt 2.9.3 change in behaviour #17

Merged
merged 1 commit into from
Apr 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions halo_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def process_halos(
t0_all = time.time()

# Count halos to do
nr_halos_left = comm.allreduce(np.sum(halo_arrays["done"].local == 0))
nr_halos_left = comm.allreduce(np.sum(halo_arrays["done"].local.value == 0))

# Loop until all halos are done
nr_halos = len(halo_arrays["index"].full)
Expand All @@ -262,7 +262,7 @@ def process_halos(
t0_task = time.time()

# Skip halos we already did
if halo_arrays["done"].full[task_to_do] == 0:
if halo_arrays["done"].full[task_to_do].value == 0:

# Extract this halo's VR information (centre, radius, index etc)
input_halo = {}
Expand Down Expand Up @@ -312,7 +312,7 @@ def process_halos(

# Count halos left to do
comm.barrier()
nr_halos_left = comm.allreduce(np.sum(halo_arrays["done"].local == 0))
nr_halos_left = comm.allreduce(np.sum(halo_arrays["done"].local.value == 0))

# Stop the clock
comm.barrier()
Expand Down
2 changes: 1 addition & 1 deletion mask_cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def mask_cells(comm, cellgrid, centre, radius, done):
for halo_nr in range(first_halo, first_halo+nr_halos_local):

# Flag cells around this halo
if done[halo_nr] == 0:
if done[halo_nr].value == 0:
pos_min = centre[halo_nr,:] - radius[halo_nr] - 0.5*cellgrid.cell_size
pos_max = centre[halo_nr,:] + radius[halo_nr] + 0.5*cellgrid.cell_size
cellgrid.mask_region(mask, pos_min, pos_max)
Expand Down