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 range setup for anyv regions #211

Merged
merged 1 commit into from
May 2, 2024
Merged
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: 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
Loading