Skip to content

Commit 0b2b7d9

Browse files
author
Michael Abbott
committed
fix the fix
1 parent 752eb7e commit 0b2b7d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/SliceMap.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ function threadmap(f::Function, vw::AbstractVector...)
297297
length(first(vw))==0 && error("can't map over empty vector, sorry")
298298
length(vw)==2 && (isequal(length.(vw)...) || error("lengths must be equal"))
299299
out1 = f(first.(vw)...)
300-
if length(vw) > 1
300+
if length(first(vw)) > 1
301301
_threadmap(out1, f, vw...)
302302
else
303303
[out1]
@@ -321,7 +321,7 @@ else
321321
ell = length(first(vw))
322322
out = Vector{typeof(out1)}(undef, ell)
323323
out[1] = out1
324-
Base.@sync for is in Iterators.partition(2:ell, div(ell, Threads.nthreads()))
324+
Base.@sync for is in Iterators.partition(2:ell, cld(ell-1, Threads.nthreads()))
325325
Threads.@spawn for i in is
326326
@inbounds out[i] = f(getindex.(vw, i)...)
327327
end

0 commit comments

Comments
 (0)