Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a wrapper for Krylov.jl and the block-GMRES implementation in ExaPF.jl #69

Closed
wants to merge 11 commits into from

Conversation

amontoison
Copy link
Member

François, I interfaced block-GMRES today and I observed that the linear systems with one right-hand side are inconsistent numerically.
This issue is triggered here.
I observed this phenomenon with the problem case300m.

@frapac
Copy link
Member

frapac commented Nov 9, 2023

I just ran the tests locally. The results are interesting:

  • the tests are passing for case118.m
  • case300.m is breaking because of GMRES, as you observed. I noticed we are not using any preconditioner, would that solve the issue? Or what do you mean exactly by "numerically inconsistent"?
  • case2869pegase.m returns NaN in the 5th call to block-gmres.
  • case1354pegase.m breaks with the following message:
CK-GMRES: system of size 2447 with 256 right-hand sides
 pass      k     ‖Rₖ‖  timer
    0      0  1.6e+01  0.00s
    1      1  8.2e+00  0.06s
    1      2  5.1e+00  0.11s
    1      3  3.6e+00  0.18s
    1      4  2.7e+00  0.27s
    1      5  2.0e+00  0.37s
    1      6  1.4e+00  0.49s
    1      7  1.1e+00  0.62s
    1      8  8.7e-01  0.76s
    1      9  5.9e-01  0.92s
    1     10  2.1e-01  1.09s
    1     11  7.6e-13  1.28s
ERROR: LAPACKException(5)
Stacktrace:
  [1] chklapackerror
    @ ~/.julia/juliaup/julia-1.9.3+0.x64.linux.gnu/share/julia/stdlib/v1.9/LinearAlgebra/src/lapack.jl:40 [inlined]
  [2] trtrs!(uplo::Char, trans::Char, diag::Char, A::Matrix{Float64}, B::Matrix{Float64})
    @ LinearAlgebra.LAPACK ~/.julia/juliaup/julia-1.9.3+0.x64.linux.gnu/share/julia/stdlib/v1.9/LinearAlgebra/src/lapack.jl:3424
  [3] ldiv!
    @ ~/.julia/juliaup/julia-1.9.3+0.x64.linux.gnu/share/julia/stdlib/v1.9/LinearAlgebra/src/triangular.jl:727 [inlined]
  [4] block_gmres!(solver::ExaPF.LinearSolvers.BlockGmresSolver{Float64, Float64, Vector{Float64}, Matrix{Float64}}, A::SparseArrays.SparseMatrixCSC{Float64, Int64}, B::Matrix{Float64}; M::UniformScaling{Bool}, N::UniformScaling{Bool}, ldiv::Bool, restart::Bool, reorthogonalization::Bool, atol::Float64, rtol::Float64, itmax::Int64, timemax::Float64, verbose::Int64, history::Bool)
    @ ExaPF.LinearSolvers ~/.julia/packages/ExaPF/63axT/src/LinearSolvers/block_gmres.jl:311
  [5] block_gmres!
    @ ~/.julia/packages/ExaPF/63axT/src/LinearSolvers/block_gmres.jl:107 [inlined]
  [6] ldiv!
    @ ~/dev/Argos.jl/src/krylov.jl:32 [inlined]
  [7] mul!
    @ ~/dev/Argos.jl/src/reduction.jl:25 [inlined]
  [8] adjoint_adjoint_reduction!(red::Argos.BatchReduction{Matrix{Float64}, Argos.ImplicitSensitivity{Argos.KrylovWrapper{Float64, SparseArrays.SparseMatrixCSC{Float64, Int64}, ExaPF.LinearSolvers.BlockGmresSolver{Float64, Float64, Vector{Float64}, Matrix{Float64}}, Krylov.GmresSolver{Float64, Float64, Vector{Float64}}}, SparseArrays.SparseMatrixCSC{Float64, Int64}}}, hessvec::SubArray{Float64, 2, Matrix{Float64}, Tuple{Base.Slice{Base.OneTo{Int64}}, UnitRange{Int64}}, true}, H::Argos.HJDJ{Vector{Int64}, Vector{Float64}, SparseArrays.SparseMatrixCSC{Float64, Int64}}, w::Matrix{Float64})
    @ Argos ~/dev/Argos.jl/src/reduction.jl:136
  [9] reduce!(red::Argos.BatchReduction{Matrix{Float64}, Argos.ImplicitSensitivity{Argos.KrylovWrapper{Float64, SparseArrays.SparseMatrixCSC{Float64, Int64}, ExaPF.LinearSolvers.BlockGmresSolver{Float64, Float64, Vector{Float64}, Matrix{Float64}}, Krylov.GmresSolver{Float64, Float64, Vector{Float64}}}, SparseArrays.SparseMatrixCSC{Float64, Int64}}}, dest::Matrix{Float64}, W::Argos.HJDJ{Vector{Int64}, Vector{Float64}, SparseArrays.SparseMatrixCSC{Float64, Int64}})
    @ Argos ~/dev/Argos.jl/src/reduction.jl:210
 [10] macro expansion
    @ ~/dev/Argos.jl/src/KKT/reduced_newton.jl:345 [inlined]
 [11] macro expansion
    @ ./timing.jl:393 [inlined]
 [12] build_kkt!(kkt::Argos.BieglerKKTSystem{Float64, Vector{Int64}, Vector{Float64}, Matrix{Float64}, SparseArrays.SparseMatrixCSC{Float64, Int64}, Argos.KrylovWrapper{Float64, SparseArrays.SparseMatrixCSC{Float64, Int64}, ExaPF.LinearSolvers.BlockGmresSolver{Float64, Float64, Vector{Float64}, Matrix{Float64}}, Krylov.GmresSolver{Float64, Float64, Vector{Float64}}}})
    @ Argos ~/dev/Argos.jl/src/KKT/reduced_newton.jl:344
 [13] test_biegler_kkt(casename::String)
    @ Main ~/dev/Argos.jl/test/kkt.jl:40
 [14] top-level scope
    @ REPL[14]:1

@amontoison amontoison closed this Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants