Skip to content

Commit 2d3822f

Browse files
committed
comments
1 parent 08f6177 commit 2d3822f

File tree

2 files changed

+24
-20
lines changed

2 files changed

+24
-20
lines changed

src/pardiso.jl

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
## Paradiso
2+
## Pardiso
33

44
import Pardiso
55

@@ -17,10 +17,10 @@ Base.@kwdef struct PardisoJL <: SciMLLinearSolveAlgorithm
1717
end
1818

1919
MKLPardisoFactorize(;kwargs...) = PardisoJL(;fact_phase=Pardiso.NUM_FACT,
20-
solve_phase=Pardiso.SOLVE_ITERATIVE_REFINE,
21-
kwargs...)
20+
solve_phase=Pardiso.SOLVE_ITERATIVE_REFINE,
21+
kwargs...)
2222
MKLPardisoIterate(;kwargs...) = PardisoJL(;solve_phase=Pardiso.NUM_FACT_SOLVE_REFINE,
23-
kwargs...)
23+
kwargs...)
2424

2525
# TODO schur complement functionality
2626

@@ -50,9 +50,7 @@ function init_cacheval(alg::PardisoJL, cache::LinearCache)
5050
matrix_type !== nothing && Pardiso.set_matrixtype!(solver, matrix_type)
5151
cache.verbose && Pardiso.set_msglvl!(solver, Pardiso.MESSAGE_LEVEL_ON)
5252

53-
"""
54-
pass in vector of tuples like [(iparm::Int, key::Int) ...]
55-
"""
53+
# pass in vector of tuples like [(iparm::Int, key::Int) ...]
5654
if iparm !== nothing
5755
for i in length(iparm)
5856
Pardiso.set_iparm!(solver, iparm[i]...)
@@ -66,7 +64,6 @@ function init_cacheval(alg::PardisoJL, cache::LinearCache)
6664
end
6765

6866
if (fact_phase !== nothing) | (solve_phase !== nothing)
69-
# ensure phase is being changed afterwards?
7067
Pardiso.set_phase!(solver, Pardiso.ANALYSIS)
7168
Pardiso.pardiso(solver, u, A, b)
7269
end
@@ -76,12 +73,6 @@ function init_cacheval(alg::PardisoJL, cache::LinearCache)
7673
Pardiso.pardiso(solver, u, A, b)
7774
end
7875

79-
"""
80-
use ipram/dpram to set tolerances???
81-
"""
82-
# abstol = cache.abstol
83-
# reltol = cache.reltol
84-
8576
return solver
8677
end
8778

test/runtests.jl

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,22 +131,35 @@ end
131131

132132
using Pardiso, SparseArrays
133133

134-
A = sparse([ 1. 0 -2 3
134+
A1 = sparse([ 1. 0 -2 3
135135
0 5 1 2
136136
-2 1 4 -7
137137
3 2 -7 5 ])
138-
b = rand(4)
139-
u = zero(b)
138+
b1 = rand(4)
139+
prob1 = LinearProblem(A1, b1)
140+
141+
lambda = 3
142+
e = ones(n)
143+
e2 = ones(n-1)
144+
A2 = spdiagm(-1 => im*e2, 0 => lambda*e, 1 => -im*e2)
145+
b2 = rand(n) + im * zeros(n)
146+
147+
prob2 = LinearProblem(A2, b2)
140148

141-
prob = LinearProblem(A, b)
142149
for alg in (
143150
PardisoJL(),
144151
MKLPardisoFactorize(),
145152
MKLPardisoIterate(),
146153
)
147154

148-
u = solve(prob, alg; cache_kwargs...)
149-
@test A * u b
155+
u = solve(prob1, alg; cache_kwargs...)
156+
@test A1 * u b1
157+
158+
# common interface doesn't support complex types
159+
# https://github.com/SciML/LinearSolve.jl/issues/38
160+
161+
# u = solve(prob2, alg; cache_kwargs...)
162+
# @test A2 * u ≈ b2
150163
end
151164

152165
end

0 commit comments

Comments
 (0)