Skip to content

Commit

Permalink
Merge pull request #211 from mabarnes/anyv-loop-setup-fix
Browse files Browse the repository at this point in the history
Fix range setup for `anyv` regions
  • Loading branch information
johnomotani authored May 2, 2024
2 parents 20cadd5 + 0d0a90d commit f168743
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion moment_kinetics/src/looping.jl
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function get_local_range(sub_block_rank, sub_block_size, dim_size)
# This calculation is not at all optimized, but is not going to take long, and is
# only done in initialization, so it is more important to be simple and robust.

if dim_size == 0
if dim_size == 0 || sub_block_rank sub_block_size
# No processor includes a grid point
return 1:0
end
Expand Down Expand Up @@ -270,6 +270,10 @@ function get_ranges_from_split(block_rank, effective_block_size, split, dim_size
# This process is not needed by this split
return [1:0 for _ dim_sizes_list]
end
if effective_block_size < prod(split)
error("effective_block_size=$effective_block_size is smaller than "
* "prod(split)=", prod(split))
end

# Get rank of this process in each sub-block (with sub-block sizes given by split).
sb_ranks = zeros(mk_int, length(dim_sizes_list))
Expand Down

0 comments on commit f168743

Please sign in to comment.