Skip to content

Commit 92065df

Browse files
committed
Use testsets instead of FactCheck.
Define arithmetic between DArray and Array. It used to either fail or fall back to the very inefficient AbstractArray implementation. Enable test that had been disabled because of a bug in Base. The bug is fixed now.
1 parent 5eedeb1 commit 92065df

File tree

4 files changed

+276
-289
lines changed

4 files changed

+276
-289
lines changed

src/DistributedArrays.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,13 +902,17 @@ for f in (:+, :-, :div, :mod, :rem, :&, :|, :$)
902902
B = samedist(A, B)
903903
map_localparts($f, A, B)
904904
end
905+
($f){T}(A::DArray{T}, B::Array{T}) = ($f)(A, distribute(B, A))
906+
($f){T}(A::Array{T}, B::DArray{T}) = ($f)(distribute(A, B), B)
905907
end
906908
end
907909
for f in (:.+, :.-, :.*, :./, :.%, :.<<, :.>>)
908910
@eval begin
909911
function ($f){T}(A::DArray{T}, B::DArray{T})
910912
map_localparts($f, A, B)
911913
end
914+
($f){T}(A::DArray{T}, B::Array{T}) = ($f)(A, distribute(B, A))
915+
($f){T}(A::Array{T}, B::DArray{T}) = ($f)(distribute(A, B), B)
912916
end
913917
end
914918

test/REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
FactCheck 0.2.3-
21
StatsBase
2+
BaseTestNext

0 commit comments

Comments
 (0)