Skip to content

Commit

Permalink
Merge pull request #158 from JuliaParallel/fbot/deps
Browse files Browse the repository at this point in the history
Fix deprecations
  • Loading branch information
andreasnoack committed Jul 28, 2018
2 parents 1241687 + b1d7193 commit f8c26bd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/darray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,9 @@ function distribute(A::AbstractArray, DA::DArray)
return DArray(I->localpart(s), DA)
end

(::Type{DArray{T,N,S}})(A::S) where {T,N,S<:AbstractArray} = distribute(convert(AbstractArray{T,N}, A))
DArray{T,N,S}(A::S) where {T,N,S<:AbstractArray} = distribute(convert(AbstractArray{T,N}, A))

function (::Type{Array{S,N}})(d::DArray{T,N}) where {S,T,N}
function Array{S,N}(d::DArray{T,N}) where {S,T,N}
a = Array{S}(undef, size(d))
@sync begin
for i = 1:length(d.pids)
Expand All @@ -528,7 +528,7 @@ function (::Type{Array{S,N}})(d::DArray{T,N}) where {S,T,N}
return a
end

function (::Type{Array{S,N}})(s::SubDArray{T,N}) where {S,T,N}
function Array{S,N}(s::SubDArray{T,N}) where {S,T,N}
I = s.indices
d = s.parent
if isa(I,Tuple{Vararg{UnitRange{Int}}}) && S<:T && T<:S && !isempty(s)
Expand All @@ -543,7 +543,7 @@ function (::Type{Array{S,N}})(s::SubDArray{T,N}) where {S,T,N}
return a
end

function (::Type{DArray})(SD::SubArray{T,N}) where {T,N}
function DArray(SD::SubArray{T,N}) where {T,N}
D = SD.parent
DArray(size(SD), procs(D)) do I
lindices = Base.reindex(SD, SD.indices, I)
Expand Down

0 comments on commit f8c26bd

Please sign in to comment.