Closed raminammour closed 5 years ago
It is caused by this part:
function DArray(id, init, dims, pids, idxs, cuts)
r=Channel(1)
@sync begin
for i = 1:length(pids)
@async begin
local typA
if isa(init, Function)
typA=remotecall_fetch(construct_localparts, pids[i], init, id, dims, pids, idxs, cuts)
else
# constructing from an array of remote refs.
typA=remotecall_fetch(construct_localparts, pids[i], init[i], id, dims, pids, idxs, cuts)
end
!isready(r) && put!(r, typA)
end
end
end
A = take!(r)
if myid() in pids
d = registry[id]
d = isa(d, WeakRef) ? d.value : d
else
T = eltype(A)
N = length(dims)
d = DArray{T,N,A}(id, dims, pids, idxs, cuts, empty_localpart(T,N,A))
end
d
end
It is whichever process pushes eltype
to the channel first. Somehow, all types should be reduced and checked to be the same before inferring eltype
. Will see if I can fix this...
Hello,
I found this while testing the fix for the other issue, you must hate me by now ;)
Here is a minimal example, if the worker that infers the wrong type is slowed down with a sleep statement, inference is ok.
Cheers!
p.s: thanks for a great package, despite any issues i may file :)