Skip to content

Commit d8551f2

Browse files
committed
Pardiso parameter handling
1 parent 91791f2 commit d8551f2

File tree

3 files changed

+25
-16
lines changed

3 files changed

+25
-16
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ExtendableSparse"
22
uuid = "95c220a8-a1cf-11e9-0c77-dbfce5f500b3"
33
authors = ["Juergen Fuhrmann <juergen.fuhrmann@wias-berlin.de>"]
4-
version = "0.6.2"
4+
version = "0.6.3"
55

66
[deps]
77
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"

src/pardiso_lu.jl

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ mutable struct PardisoLU{Tv, Ti} <: AbstractPardisoLU{Tv,Ti}
66
phash::UInt64
77
end
88

9-
function PardisoLU{Tv,Ti}(;iparm=nothing,dparm=nothing,matrixtype=nothing) where {Tv,Ti}
9+
function PardisoLU{Tv,Ti}(;iparm=nothing,dparm=nothing,mtype=nothing) where {Tv,Ti}
1010
fact=PardisoLU{Tv,Ti}(nothing,Pardiso.PardisoSolver(),0)
11-
default_initialize!(fact,iparm,dparm,matrixtype)
11+
default_initialize!(fact,iparm,dparm,mtype)
1212
end
1313

1414
"""
@@ -17,16 +17,16 @@ PardisoLU(;valuetype=Float64,
1717
indextype=Int64,
1818
iparm::Vector,
1919
dparm::Vector,
20-
matrixtype=Int)
20+
mtype::Int)
2121
22-
PardisoLU(matrix; iparm,dparm,matrixtype)
22+
PardisoLU(matrix; iparm,dparm,mtype)
2323
```
2424
2525
LU factorization based on pardiso. For using this, you need to issue `using Pardiso`
2626
and have the pardiso library from [pardiso-project.org](https://pardiso-project.org)
2727
[installed](https://github.com/JuliaSparse/Pardiso.jl#pardiso-60).
2828
29-
The optional keyword arguments `matrixtype`, `iparm` and `dparm` are
29+
The optional keyword arguments `mtype`, `iparm` and `dparm` are
3030
(Pardiso internal parameters)[https://github.com/JuliaSparse/Pardiso.jl#readme].
3131
3232
Forsetting them, one can also access the `PardisoSolver` e.g. like
@@ -46,9 +46,9 @@ mutable struct MKLPardisoLU{Tv, Ti} <: AbstractPardisoLU{Tv,Ti}
4646
phash::UInt64
4747
end
4848

49-
function MKLPardisoLU{Tv,Ti}(;iparm=nothing,matrixtype=nothing) where {Tv,Ti}
49+
function MKLPardisoLU{Tv,Ti}(;iparm=nothing,mtype=nothing) where {Tv,Ti}
5050
fact=MKLPardisoLU{Tv,Ti}(nothing,Pardiso.MKLPardisoSolver(),0)
51-
default_initialize!(fact, iparm,nothing,matrixtype)
51+
default_initialize!(fact, iparm,nothing,mtype)
5252
end
5353

5454

@@ -57,15 +57,15 @@ end
5757
MKLPardisoLU(;valuetype=Float64,
5858
indextype=Int64,
5959
iparm::Vector,
60-
matrixtype=Int)
60+
mtype::Int)
6161
62-
MKLPardisoLU(matrix; iparm, matrixtype)
62+
MKLPardisoLU(matrix; iparm, mtype)
6363
```
6464
6565
LU factorization based on pardiso. For using this, you need to issue `using Pardiso`.
6666
This version uses the early 2000's fork in Intel's MKL library.
6767
68-
The optional keyword arguments `matrixtype` and `iparm` are
68+
The optional keyword arguments `mtype` and `iparm` are
6969
(Pardiso internal parameters)[https://github.com/JuliaSparse/Pardiso.jl#readme].
7070
7171
For setting them you can also access the `PardisoSolver` e.g. like
@@ -79,13 +79,13 @@ MKLPardisoLU(;valuetype::Type=Float64, indextype::Type=Int64,kwargs...)=MKLPardi
7979

8080

8181
##########################################################################################
82-
function default_initialize!(fact::AbstractPardisoLU{Tv,Ti}, iparm,dparm,matrixtype) where {Tv, Ti}
83-
if !isnothing(matrixtype)
84-
my_matrixtype=matrixtype
82+
function default_initialize!(fact::AbstractPardisoLU{Tv,Ti}, iparm,dparm,mtype) where {Tv, Ti}
83+
if !isnothing(mtype)
84+
my_mtype=mtype
8585
elseif Tv<:Complex
86-
my_matrixtype=Pardiso.COMPLEX_NONSYM
86+
my_mtype=Pardiso.COMPLEX_NONSYM
8787
else
88-
my_matrixtype=Pardiso.REAL_NONSYM
88+
my_mtype=Pardiso.REAL_NONSYM
8989
end
9090

9191
Pardiso.set_matrixtype!(fact.ps,Pardiso.REAL_NONSYM)

test/runtests.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,10 @@ end
370370
@test test_lu2(10,10,10,lufac=MKLPardisoLU())
371371
@test test_lu2(25,40,1,lufac=MKLPardisoLU())
372372
@test test_lu2(1000,1,1,lufac=MKLPardisoLU())
373+
374+
@test test_lu2(10,10,10,lufac=MKLPardisoLU(mtype=2))
375+
@test test_lu2(25,40,1,lufac=MKLPardisoLU(mtype=2))
376+
@test test_lu2(1000,1,1,lufac=MKLPardisoLU(mtype=2))
373377
end
374378

375379

@@ -382,6 +386,11 @@ if Pardiso.PARDISO_LOADED[]
382386
@test test_lu2(10,10,10,lufac=PardisoLU())
383387
@test test_lu2(25,40,1,lufac=PardisoLU())
384388
@test test_lu2(1000,1,1,lufac=PardisoLU())
389+
390+
@test test_lu2(10,10,10,lufac=PardisoLU(mtype=2))
391+
@test test_lu2(25,40,1,lufac=PardisoLU(mtype=2))
392+
@test test_lu2(1000,1,1,lufac=PardisoLU(mtype=2))
393+
385394
end
386395
end
387396

0 commit comments

Comments
 (0)