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 BLOCK-GMRES in ExaPF.jl #281

Merged
merged 4 commits into from
Oct 31, 2023
Merged

Add BLOCK-GMRES in ExaPF.jl #281

merged 4 commits into from
Oct 31, 2023

Conversation

amontoison
Copy link
Member

using ExaPF.LS

A = rand(10,10)
B = rand(10,4)
X0 = ones(10,4)

solver = BlockGmresSolver(A, B)
block_gmres!(solver, A, B, verbose=1)
R = B - A * solver.X
println(norm(R))

block_gmres!(solver, A, B, X0, verbose=1)
R = B - A * solver.X
println(norm(R))

block_gmres(A, B, verbose=1)
R = B - A * solver.X
println(norm(R))

block_gmres(A, B, X0, verbose=1)
R = B - A * solver.X
println(norm(R))
julia> block_gmres!(solver, A, B, verbose=1)
BLOCK-GMRES: system of size 10 with 4 right-hand sides
 pass      k     ‖Rₖ‖  timer
    0      0  3.8e+00  0.50s
    1      1  1.4e+00  0.88s
    1      2  7.4e-01  0.88s
    1      3  1.0e-15  0.88s

┌──────────────────┬────────────────────────┬──────────────────┐
│  BlockGmresSolver│               nrows: 10│         ncols: 10│
├──────────────────┼────────────────────────┼──────────────────┤
│Precision: Float64│       Architecture: CPU│Storage: 1.314 KiB│
├──────────────────┼────────────────────────┼──────────────────┤
│         Attribute│                    Type│              Size│
├──────────────────┼────────────────────────┼──────────────────┤
│                 m│                   Int64│           8 bytes│
│                 n│                   Int64│           8 bytes│
│                 p│                   Int64│           8 bytes│
│                 X│         Matrix{Float64}│         320 bytes│
│                 W│         Matrix{Float64}│         320 bytes│
│                 C│         Matrix{Float64}│         128 bytes│
│                 D│         Matrix{Float64}│         256 bytes│
│                 V│ Vector{Matrix{Float64}}│          24 bytes│
│                 Z│ Vector{Matrix{Float64}}│          24 bytes│
│                 R│ Vector{Matrix{Float64}}│          48 bytes│
│                 H│ Vector{Matrix{Float64}}│          24 bytes│
│                 τ│ Vector{Vector{Float64}}│         120 bytes│
│        warm_start│                    Bool│            1 byte│
│             stats│BlockGmresStats{Float64}│          57 bytes│
└──────────────────┴────────────────────────┴──────────────────┘

BlockGmresStats
 niter: 3
 solved: true
 residuals: []
 timer: 902.33ms
 status: solution good enough given atol and rtol

@michel2323
Copy link
Member

We just need docs for

│     ExaPF.LinearSolvers.block_gmres
│     ExaPF.LinearSolvers.BlockKrylovSolver
│     ExaPF.LinearSolvers.BlockGmresSolver
│     ExaPF.LinearSolvers.block_gmres!

and we are good to go!

@codecov
Copy link

codecov bot commented Oct 30, 2023

Codecov Report

Merging #281 (eeb2876) into main (f28191f) will decrease coverage by 4.95%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #281      +/-   ##
==========================================
- Coverage   74.38%   69.44%   -4.95%     
==========================================
  Files          33       35       +2     
  Lines        4185     4483     +298     
==========================================
  Hits         3113     3113              
- Misses       1072     1370     +298     
Files Coverage Δ
src/LinearSolvers/LinearSolvers.jl 74.62% <ø> (ø)
src/LinearSolvers/utils.jl 0.00% <0.00%> (ø)
src/LinearSolvers/block_gmres.jl 0.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@michel2323 michel2323 merged commit 7358739 into main Oct 31, 2023
2 of 4 checks passed
@amontoison amontoison deleted the am/block-gmres branch October 31, 2023 07:28
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