# Problem with LinearSolve.jl and PardisoJL()

**URL:** <https://discourse.julialang.org/t/problem-with-linearsolve-jl-and-pardisojl/113595>\
**Category:** General Usage\
**Tags:** linearsolve, pardiso\
**Created:** [April 28, 2024, 8:09pm UTC](https://discourse.julialang.org/t/problem-with-linearsolve-jl-and-pardisojl/113595 "2024-04-28T20:09:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MichelJuillard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/micheljuillard/32/10555_2.png) [@MichelJuillard](https://discourse.julialang.org/u/MichelJuillard)\
**Post date:** [April 28, 2024, 8:09pm UTC](https://discourse.julialang.org/t/problem-with-linearsolve-jl-and-pardisojl/113595/1 "2024-04-28T20:09:42Z")

</div>

I encounter a problem using `LinearSolve` to solve a sparse linear system with `PardisoJL()`:  
The test case, `test_PardisoJL.jl`:

```julia
using Pkg
Pkg.activate(; temp=true)
Pkg.add("LinearSolve")
Pkg.add("Pardiso")

using LinearAlgebra
using LinearSolve
using Random
using SparseArrays
import Pardiso

include("A.jl")

A = makeA()
b = ones(size(A, 1))

linprob = LinearProblem(A, b)
x1 = LinearSolve.solve(linprob, PardisoJL())
x2 = A\b

@show norm(x1 - x2)

```

the result is clearly wrong. Matrix `A` is a 60x60 `SparseMatrixCSC` constructed in `A.jl`

`test_pardiso.jl` show that using `Pardiso` directly works fine:

```julia
using Pkg
Pkg.activate(; temp=true)
Pkg.add("MKL")
Pkg.add("Pardiso")

using LinearAlgebra
using MKL
using Random
using SparseArrays
using Pardiso

include("A.jl")

A = makeA()
b = ones(size(A, 1))

ps = MKLPardisoSolver()

x1 = similar(b)
Pardiso.solve!(ps, x1, A, b)

x2 = A\b

@show norm(x1 - x2)

```

[test\_PardisoJL.jl](https://discourse.julialang.org/uploads/short-url/rtTOPIgZa9u8h1o2XBq9d3MPuA8.jl) (321 Bytes)  
[test\_pardiso.jl](https://discourse.julialang.org/uploads/short-url/qIIoUA8u0zaZp0CEVHTVDpk4BUa.jl) (300 Bytes)  
[A.jl](https://discourse.julialang.org/uploads/short-url/qkCkcNi5li3spm8Stzacl6OwQHH.jl) (4.2 KB)

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [April 28, 2024, 8:18pm UTC](https://discourse.julialang.org/t/problem-with-linearsolve-jl-and-pardisojl/113595/2 "2024-04-28T20:18:05Z")

</div>

Can you open an issue? This is more of a bug report than a discussion.

---

<div class="post-metadata">

**Author:** ![MichelJuillard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/micheljuillard/32/10555_2.png) [@MichelJuillard](https://discourse.julialang.org/u/MichelJuillard)\
**Post date:** [April 28, 2024, 8:27pm UTC](https://discourse.julialang.org/t/problem-with-linearsolve-jl-and-pardisojl/113595/3 "2024-04-28T20:27:15Z")

</div>

Sure. I’m doing it now
