Skip to content

Commit

Permalink
return nothing in whichproc_localindex (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub committed Jun 6, 2021
1 parent 2f26946 commit 9ea2827
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/productsplit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,9 @@ julia> ParallelUtilities.ProductSplit(iters, np, 4) |> collect
"""
function whichproc_localindex(iterators::Tuple{Vararg{AbstractRange}}, val::Tuple, np::Integer)
procid = whichproc(iterators, val, np)
procid === nothing && return nothing
index = localindex(ProductSplit(iterators, np, procid), val)
index === nothing && return nothing
return procid, index
end

Expand Down
1 change: 1 addition & 0 deletions test/productsplit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ end
end
end
end
@test whichproc_localindex((1:1,1:1), (1,2), 1) === nothing
end

@testset "getindex" begin
Expand Down

0 comments on commit 9ea2827

Please sign in to comment.