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
  • Loading branch information
sbromberger authored and vchuravy committed Aug 24, 2018
1 parent 35c67e5 commit 145224f
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

1 comment on commit 145224f

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

Please sign in to comment.