Skip to content

Commit 9ea2827

Browse files
authored
return nothing in whichproc_localindex (#12)
1 parent 2f26946 commit 9ea2827

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/productsplit.jl

+2
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,9 @@ julia> ParallelUtilities.ProductSplit(iters, np, 4) |> collect
906906
"""
907907
function whichproc_localindex(iterators::Tuple{Vararg{AbstractRange}}, val::Tuple, np::Integer)
908908
procid = whichproc(iterators, val, np)
909+
procid === nothing && return nothing
909910
index = localindex(ProductSplit(iterators, np, procid), val)
911+
index === nothing && return nothing
910912
return procid, index
911913
end
912914

test/productsplit.jl

+1
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ end
337337
end
338338
end
339339
end
340+
@test whichproc_localindex((1:1,1:1), (1,2), 1) === nothing
340341
end
341342

342343
@testset "getindex" begin

0 commit comments

Comments
 (0)