Skip to content

Commit

Permalink
Display storage allocated in the stats
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison committed Oct 31, 2024
1 parent 9536ef7 commit bd6cf25
Show file tree
Hide file tree
Showing 40 changed files with 168 additions and 56 deletions.
3 changes: 3 additions & 0 deletions src/bicgstab.jl
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ kwargs_bicgstab = (:c, :M, :N, :ldiv, :atol, :rtol, :itmax, :timemax, :verbose,
if rNorm == 0
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
solver.warm_start = false
Expand All @@ -187,6 +188,7 @@ kwargs_bicgstab = (:c, :M, :N, :ldiv, :atol, :rtol, :itmax, :timemax, :verbose,
if next_ρ == 0
stats.niter = 0
stats.solved, stats.inconsistent = false, false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "Breakdown bᴴc = 0"
solver.warm_start = false
Expand Down Expand Up @@ -260,6 +262,7 @@ kwargs_bicgstab = (:c, :M, :N, :ldiv, :atol, :rtol, :itmax, :timemax, :verbose,
stats.niter = iter
stats.solved = solved
stats.inconsistent = false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = status
return solver
Expand Down
3 changes: 3 additions & 0 deletions src/bilq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ kwargs_bilq = (:c, :transfer_to_bicg, :M, :N, :ldiv, :atol, :rtol, :itmax, :time
stats.niter = 0
stats.solved = true
stats.inconsistent = false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
solver.warm_start = false
Expand All @@ -179,6 +180,7 @@ kwargs_bilq = (:c, :transfer_to_bicg, :M, :N, :ldiv, :atol, :rtol, :itmax, :time
stats.niter = 0
stats.solved = false
stats.inconsistent = false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "Breakdown bᴴc = 0"
solver.warm_start = false
Expand Down Expand Up @@ -393,6 +395,7 @@ kwargs_bilq = (:c, :transfer_to_bicg, :M, :N, :ldiv, :atol, :rtol, :itmax, :time
stats.niter = iter
stats.solved = solved_lq || solved_cg
stats.inconsistent = false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = status
return solver
Expand Down
2 changes: 2 additions & 0 deletions src/bilqr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ kwargs_bilqr = (:transfer_to_bicg, :atol, :rtol, :itmax, :timemax, :verbose, :hi
stats.niter = 0
stats.solved_primal = false
stats.solved_dual = false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "Breakdown bᴴc = 0"
solver.warm_start = false
Expand Down Expand Up @@ -468,6 +469,7 @@ kwargs_bilqr = (:transfer_to_bicg, :atol, :rtol, :itmax, :timemax, :verbose, :hi
stats.niter = iter
stats.solved_primal = solved_primal
stats.solved_dual = solved_dual
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = status
return solver
Expand Down
1 change: 1 addition & 0 deletions src/block_gmres.jl
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ kwargs_block_gmres = (:M, :N, :ldiv, :restart, :reorthogonalization, :atol, :rto
# Update stats
stats.niter = iter
stats.solved = solved
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = status
return solver
Expand Down
2 changes: 2 additions & 0 deletions src/car.jl
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ kwargs_car = (:M, :ldiv, :atol, :rtol, :itmax, :timemax, :verbose, :history, :ca
if rNorm == 0
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
solver.warm_start = false
Expand Down Expand Up @@ -239,6 +240,7 @@ kwargs_car = (:M, :ldiv, :atol, :rtol, :itmax, :timemax, :verbose, :history, :ca
stats.niter = iter
stats.solved = solved
stats.inconsistent = inconsistent
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = status
return solver
Expand Down
2 changes: 2 additions & 0 deletions src/cg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ kwargs_cg = (:M, :ldiv, :radius, :linesearch, :atol, :rtol, :itmax, :timemax, :v
if γ == 0
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
solver.warm_start = false
Expand Down Expand Up @@ -257,6 +258,7 @@ kwargs_cg = (:M, :ldiv, :radius, :linesearch, :atol, :rtol, :itmax, :timemax, :v
stats.niter = iter
stats.solved = solved
stats.inconsistent = inconsistent
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = status
return solver
Expand Down
2 changes: 2 additions & 0 deletions src/cg_lanczos.jl
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ kwargs_cg_lanczos = (:M, :ldiv, :check_curvature, :atol, :rtol, :itmax, :timemax
stats.solved = true
stats.Anorm = zero(T)
stats.indefinite = false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
solver.warm_start = false
Expand Down Expand Up @@ -247,6 +248,7 @@ kwargs_cg_lanczos = (:M, :ldiv, :check_curvature, :atol, :rtol, :itmax, :timemax
stats.solved = solved
stats.Anorm = sqrt(Anorm2)
stats.indefinite = indefinite
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = status
return solver
Expand Down
2 changes: 2 additions & 0 deletions src/cg_lanczos_shift.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ kwargs_cg_lanczos_shift = (:M, :ldiv, :check_curvature, :atol, :rtol, :itmax, :t
if β == 0
stats.niter = 0
stats.solved = true
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
return solver
Expand Down Expand Up @@ -267,6 +268,7 @@ kwargs_cg_lanczos_shift = (:M, :ldiv, :check_curvature, :atol, :rtol, :itmax, :t
# Update stats. TODO: Estimate Anorm and Acond.
stats.niter = iter
stats.solved = solved
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = status
return solver
Expand Down
2 changes: 2 additions & 0 deletions src/cgls.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ kwargs_cgls = (:M, :ldiv, :radius, :λ, :atol, :rtol, :itmax, :timemax, :verbose
if bNorm == 0
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
history && push!(rNorms, zero(T))
Expand Down Expand Up @@ -228,6 +229,7 @@ kwargs_cgls = (:M, :ldiv, :radius, :λ, :atol, :rtol, :itmax, :timemax, :verbose
stats.niter = iter
stats.solved = solved
stats.inconsistent = false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = status
return solver
Expand Down
2 changes: 2 additions & 0 deletions src/cgls_lanczos_shift.jl
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ kwargs_cgls_lanczos_shift = (:M, :ldiv, :atol, :rtol, :itmax, :timemax, :verbose
if β == 0
stats.niter = 0
stats.solved = true
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
return solver
Expand Down Expand Up @@ -261,6 +262,7 @@ kwargs_cgls_lanczos_shift = (:M, :ldiv, :atol, :rtol, :itmax, :timemax, :verbose
# Update stats
stats.niter = iter
stats.solved = solved
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = status
return solver
Expand Down
2 changes: 2 additions & 0 deletions src/cgne.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ kwargs_cgne = (:N, :ldiv, :λ, :atol, :rtol, :itmax, :timemax, :verbose, :histor
if rNorm == 0
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
return solver
Expand Down Expand Up @@ -237,6 +238,7 @@ kwargs_cgne = (:N, :ldiv, :λ, :atol, :rtol, :itmax, :timemax, :verbose, :histor
stats.niter = iter
stats.solved = solved
stats.inconsistent = inconsistent
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = status
return solver
Expand Down
3 changes: 3 additions & 0 deletions src/cgs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ kwargs_cgs = (:c, :M, :N, :ldiv, :atol, :rtol, :itmax, :timemax, :verbose, :hist
if rNorm == 0
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
solver.warm_start = false
Expand All @@ -176,6 +177,7 @@ kwargs_cgs = (:c, :M, :N, :ldiv, :atol, :rtol, :itmax, :timemax, :verbose, :hist
if ρ == 0
stats.niter = 0
stats.solved, stats.inconsistent = false, false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "Breakdown bᴴc = 0"
solver.warm_start =false
Expand Down Expand Up @@ -264,6 +266,7 @@ kwargs_cgs = (:c, :M, :N, :ldiv, :atol, :rtol, :itmax, :timemax, :verbose, :hist
stats.niter = iter
stats.solved = solved
stats.inconsistent = false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = status
return solver
Expand Down
4 changes: 4 additions & 0 deletions src/cr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ kwargs_cr = (:M, :ldiv, :radius, :linesearch, :γ, :atol, :rtol, :itmax, :timema
if ρ == 0
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
history && push!(ArNorms, zero(T))
Expand Down Expand Up @@ -202,6 +203,7 @@ kwargs_cr = (:M, :ldiv, :radius, :linesearch, :γ, :atol, :rtol, :itmax, :timema
(verbose > 0) && @printf(iostream, "nonpositive curvature detected: pᴴAp = %8.1e and rᴴAr = %8.1e\n", pAp, ρ)
stats.solved = solved
stats.inconsistent = false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "nonpositive curvature"
return solver
Expand Down Expand Up @@ -367,6 +369,7 @@ kwargs_cr = (:M, :ldiv, :radius, :linesearch, :γ, :atol, :rtol, :itmax, :timema
stats.niter = iter
stats.solved = solved
stats.inconsistent = false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "solver encountered numerical issues"
solver.warm_start = false
Expand Down Expand Up @@ -397,6 +400,7 @@ kwargs_cr = (:M, :ldiv, :radius, :linesearch, :γ, :atol, :rtol, :itmax, :timema
stats.niter = iter
stats.solved = solved
stats.inconsistent = false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = status
return solver
Expand Down
2 changes: 2 additions & 0 deletions src/craig.jl
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ kwargs_craig = (:M, :N, :ldiv, :transfer_to_lsqr, :sqd, :λ, :btol, :conlim, :at
if β₁ == 0
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
return solver
Expand Down Expand Up @@ -390,6 +391,7 @@ kwargs_craig = (:M, :N, :ldiv, :transfer_to_lsqr, :sqd, :λ, :btol, :conlim, :at
stats.niter = iter
stats.solved = solved
stats.inconsistent = inconsistent
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = status
return solver
Expand Down
3 changes: 3 additions & 0 deletions src/craigmr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ kwargs_craigmr = (:M, :N, :ldiv, :sqd, :λ, :atol, :rtol, :itmax, :timemax, :ver
stats.solved, stats.inconsistent = true, false
history && push!(rNorms, β)
history && push!(ArNorms, zero(T))
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
return solver
Expand Down Expand Up @@ -225,6 +226,7 @@ kwargs_craigmr = (:M, :N, :ldiv, :sqd, :λ, :atol, :rtol, :itmax, :timemax, :ver
stats.solved, stats.inconsistent = true, false
history && push!(rNorms, β)
history && push!(ArNorms, zero(T))
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a minimum least-squares solution"
return solver
Expand Down Expand Up @@ -382,6 +384,7 @@ kwargs_craigmr = (:M, :N, :ldiv, :sqd, :λ, :atol, :rtol, :itmax, :timemax, :ver
stats.niter = iter
stats.solved = solved
stats.inconsistent = inconsistent
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = status
return solver
Expand Down
2 changes: 2 additions & 0 deletions src/crls.jl
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ kwargs_crls = (:M, :ldiv, :radius, :λ, :atol, :rtol, :itmax, :timemax, :verbose
if bNorm == 0
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
history && push!(ArNorms, zero(T))
Expand Down Expand Up @@ -253,6 +254,7 @@ kwargs_crls = (:M, :ldiv, :radius, :λ, :atol, :rtol, :itmax, :timemax, :verbose
stats.niter = iter
stats.solved = solved
stats.inconsistent = false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = status
return solver
Expand Down
2 changes: 2 additions & 0 deletions src/crmr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ kwargs_crmr = (:N, :ldiv, :λ, :atol, :rtol, :itmax, :timemax, :verbose, :histor
if bNorm == 0
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
history && push!(ArNorms, zero(T))
Expand Down Expand Up @@ -229,6 +230,7 @@ kwargs_crmr = (:N, :ldiv, :λ, :atol, :rtol, :itmax, :timemax, :verbose, :histor
stats.niter = iter
stats.solved = solved
stats.inconsistent = inconsistent
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = status
return solver
Expand Down
2 changes: 2 additions & 0 deletions src/diom.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ kwargs_diom = (:M, :N, :ldiv, :reorthogonalization, :atol, :rtol, :itmax, :timem
if rNorm == 0
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
solver.warm_start = false
Expand Down Expand Up @@ -311,6 +312,7 @@ kwargs_diom = (:M, :N, :ldiv, :reorthogonalization, :atol, :rtol, :itmax, :timem
stats.niter = iter
stats.solved = solved
stats.inconsistent = false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = status
return solver
Expand Down
2 changes: 2 additions & 0 deletions src/dqgmres.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ kwargs_dqgmres = (:M, :N, :ldiv, :reorthogonalization, :atol, :rtol, :itmax, :ti
if rNorm == 0
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
solver.warm_start = false
Expand Down Expand Up @@ -313,6 +314,7 @@ kwargs_dqgmres = (:M, :N, :ldiv, :reorthogonalization, :atol, :rtol, :itmax, :ti
stats.niter = iter
stats.solved = solved
stats.inconsistent = false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = status
return solver
Expand Down
2 changes: 2 additions & 0 deletions src/fgmres.jl
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ kwargs_fgmres = (:M, :N, :ldiv, :restart, :reorthogonalization, :atol, :rtol, :i
if β == 0
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
solver.warm_start = false
Expand Down Expand Up @@ -363,6 +364,7 @@ kwargs_fgmres = (:M, :N, :ldiv, :restart, :reorthogonalization, :atol, :rtol, :i
stats.niter = iter
stats.solved = solved
stats.inconsistent = inconsistent
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = status
return solver
Expand Down
2 changes: 2 additions & 0 deletions src/fom.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ kwargs_fom = (:M, :N, :ldiv, :restart, :reorthogonalization, :atol, :rtol, :itma
if β == 0
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
solver.warm_start = false
Expand Down Expand Up @@ -343,6 +344,7 @@ kwargs_fom = (:M, :N, :ldiv, :restart, :reorthogonalization, :atol, :rtol, :itma
stats.niter = iter
stats.solved = solved
stats.inconsistent = !solved && breakdown
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = status
return solver
Expand Down
2 changes: 2 additions & 0 deletions src/gmres.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ kwargs_gmres = (:M, :N, :ldiv, :restart, :reorthogonalization, :atol, :rtol, :it
if β == 0
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
solver.warm_start = false
Expand Down Expand Up @@ -360,6 +361,7 @@ kwargs_gmres = (:M, :N, :ldiv, :restart, :reorthogonalization, :atol, :rtol, :it
stats.niter = iter
stats.solved = solved
stats.inconsistent = inconsistent
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = status
return solver
Expand Down
1 change: 1 addition & 0 deletions src/gpmr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ kwargs_gpmr = (:C, :D, :E, :F, :ldiv, :gsp, :λ, :μ, :reorthogonalization, :ato
stats.niter = iter
stats.solved = solved
stats.inconsistent = inconsistent
stats.storage = sizeof(solver)
stats.timer = start_time |> ktimer
stats.status = status
return solver
Expand Down
Loading

0 comments on commit bd6cf25

Please sign in to comment.