Skip to content

Commit

Permalink
Support ranges with different integer widths in preduce (#28651)
Browse files Browse the repository at this point in the history
(cherry picked from commit 145224f)
  • Loading branch information
sbromberger authored and KristofferC committed Feb 11, 2019
1 parent db85891 commit c53b3fe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stdlib/Distributed/src/macros.jl
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ end

function preduce(reducer, f, R)
N = length(R)
chunks = splitrange(N, nworkers())
chunks = splitrange(Int(N), nworkers())
all_w = workers()[1:length(chunks)]

w_exec = Task[]
Expand Down
8 changes: 8 additions & 0 deletions stdlib/Distributed/test/distributed_exec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1527,6 +1527,14 @@ end
a27933 = :_not_defined_27933
@test remotecall_fetch(()->a27933, first(workers())) === a27933

# PR #28651
for T in (UInt8, Int8, UInt16, Int16, UInt32, Int32, UInt64)
n = @distributed (+) for i in Base.OneTo(T(10))
i
end
@test n == 55
end

# Run topology tests last after removing all workers, since a given
# cluster at any time only supports a single topology.
rmprocs(workers())
Expand Down

0 comments on commit c53b3fe

Please sign in to comment.