Skip to content

Commit ec6eddc

Browse files
committed
use makelocal in dot
1 parent 7b4e23c commit ec6eddc

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/linalg.jl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,10 @@ function dot(x::DVector, y::DVector)
3838
if length(x) != length(y)
3939
throw(DimensionMismatch(""))
4040
end
41-
if (procs(x) != procs(y)) || (x.cuts != y.cuts)
42-
throw(ArgumentError("vectors don't have the same distribution. Not handled for efficiency reasons."))
43-
end
4441

4542
results=Any[]
46-
@sync begin
47-
for i = eachindex(x.pids)
48-
@async push!(results, remotecall_fetch((x, y, i) -> dot(localpart(x), fetch(y, i)), x.pids[i], x, y, i))
49-
end
43+
asyncmap(procs(x)) do p
44+
push!(results, remotecall_fetch((x, y) -> dot(localpart(x), makelocal(y, localindices(x)...)), x, y))
5045
end
5146
return reduce(+, results)
5247
end

0 commit comments

Comments
 (0)