Closed principejavier closed 1 year ago
@principejavier The first part is addressed in #121 . The second part is indeed caused by a missing method. We probably want to implement copyto!
for PSParseMatrix
. You can find a temporary fix here.
I'll add the missing method to the PR I already have, hopefully @fverdugo can have a look soon.
I see, thanks @JordiManyer!
Solving a nonlinear problem with PartitionedArrays+GridapDistributed+Gridap with NLSolve requires a copy of the Jacobian (a PSparseMatrix) at this point: https://github.com/JuliaNLSolvers/NLSolversBase.jl/blob/78af38393b14992ea996899c6486d971b5bfa612/src/objective_types/oncedifferentiable.jl#L231
The issue can be reproduced using the distributed linear system in the examples, i.e. https://www.francescverdugo.com/PartitionedArrays.jl/dev/examples/#Distributed-sparse-linear-solve and simply
copy(A).
This copy generates an error in the implementation of
similar
at https://github.com/fverdugo/PartitionedArrays.jl/blob/dc1a3b900f79e0057c33a2e5d913045f91c8ffdd/src/p_sparse_matrix.jl#L400 After fix it, I getI guess the solution is to overwrite Base.copy with a map over ranks and local copy. Is it @fverdugo ?