JuliaLinearAlgebra / IterativeSolvers.jl

Iterative algorithms for solving linear systems, eigensystems, and singular value problems
MIT License
394 stars 106 forks source link

Distributed matrices and vectors with DistributedArrays.jl #298

Open vlc1 opened 3 years ago

vlc1 commented 3 years ago

I'm trying to use DistributedArrays.jl, but to no avail.

Here is a MWE, where I try to invert a diagonal positive definite matrix using CG :

using LinearAlgebra, IterativeSolvers, DistributedArrays
n = 100
A = Diagonal(drand(n) .^ 2 .+ √eps())
b = drand(n)
cg(A, b)

The error message mentions some ambiguities in the methods definition, and proposes to implement the following method

copyto!(::DistributedArrays.DArray, ::Base.Broadcast.Broadcasted{T, Axes, F, Args} where {T<:Base.Broadcast.AbstractArrayStyle{0}, Axes, F, Args<:Tuple})

Any tips on how to do this would be greatly appreciated. Thanks!