# Change linear solver using JuMP, Hypatia

**URL:** <https://discourse.julialang.org/t/change-linear-solver-using-jump-hypatia/116306>\
**Category:** Optimization (Mathematical)\
**Tags:** jump\
**Created:** [June 27, 2024, 1:48pm UTC](https://discourse.julialang.org/t/change-linear-solver-using-jump-hypatia/116306 "2024-06-27T13:48:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gustave\_Robichon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustave_robichon/32/207522_2.png) [@gustave\_Robichon](https://discourse.julialang.org/u/gustave_Robichon)\
**Post date:** [June 27, 2024, 1:48pm UTC](https://discourse.julialang.org/t/change-linear-solver-using-jump-hypatia/116306/1 "2024-06-27T13:48:36Z")

</div>

Hello 🙂  
I am using Hypatia with JuMP, and I want to change the Linear Solver inside it. How can I do ? I found out the following :

> ```
> user_options = ( "mu_strategy" => "monotone", "linear_solver" => "ma27" )
> model = Model(optimizer_with_attributes(Ipopt.Optimizer, user_options...))
> 
> ```

This works well for Ipopt, but I couldn’t find the equivalent for Hypatia … I would have to change “linear\_solver” by an other right string …

an other way to write it, is :

> ```
> model = Model(Ipopt.Optimizer)
> set_attribute(model,"linear_solver","ma27")
> 
> ```

Thanks for any answer 🙂  
gustave

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [June 27, 2024, 9:25pm UTC](https://discourse.julialang.org/t/change-linear-solver-using-jump-hypatia/116306/2 "2024-06-27T21:25:16Z")

</div>

I don’t think Hypatia supports using a different linear solver like HSL, but @chriscoey or @lkapelevich will know better.

---

<div class="post-metadata">

**Author:** ![gustave\_Robichon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustave_robichon/32/207522_2.png) [@gustave\_Robichon](https://discourse.julialang.org/u/gustave_Robichon)\
**Post date:** [June 28, 2024, 9:45am UTC](https://discourse.julialang.org/t/change-linear-solver-using-jump-hypatia/116306/3 "2024-06-28T09:45:48Z")

</div>

thanks !  
here are four solvers that can be used inside Hypatia !

> **[Hypatia.jl/src/linearalgebra at master · jump-dev/Hypatia.jl](https://github.com/jump-dev/Hypatia.jl/tree/master/src/linearalgebra)**
>
> interior point solver for general convex conic optimization problems - jump-dev/Hypatia.jl

---

<div class="post-metadata">

**Author:** ![lkapelevich](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lkapelevich/32/5672_2.png) [@lkapelevich](https://discourse.julialang.org/u/lkapelevich)\
**Post date:** [June 28, 2024, 4:56pm UTC](https://discourse.julialang.org/t/change-linear-solver-using-jump-hypatia/116306/4 "2024-06-28T16:56:45Z")

</div>

Hey.

There is an option called `syssolver` that determines the strategy for solving Hypatia’s linear systems. The [default](https://github.com/jump-dev/Hypatia.jl/blob/master/src/Solvers/Solvers.jl#L210) is `Solvers.QRCholDenseSystemSolver`, so all the linear algebra is dense. You could try [`Solvers.SymIndefSparseSystemSolver{Float64}()`](https://github.com/jump-dev/Hypatia.jl/blob/5cd10fcb3b619c2183c0cad64544eef38df75f8a/src/Solvers/systemsolvers/symindef.jl#L65) if you suspecct that your problem will have sparse linear systems.

The files that you found do relate to the `fact_cache` field in the system solvers. But that’s a more subtle option. The HSL/Pardiso code probably hasn’t been used for a long time.

---

<div class="post-metadata">

**Author:** ![gustave\_Robichon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustave_robichon/32/207522_2.png) [@gustave\_Robichon](https://discourse.julialang.org/u/gustave_Robichon)\
**Post date:** [July 4, 2024, 11:04am UTC](https://discourse.julialang.org/t/change-linear-solver-using-jump-hypatia/116306/6 "2024-07-04T11:04:42Z")

</div>

OK thanks, I undestood, and it works well !

---

<div class="post-metadata">

**Author:** ![gustave\_Robichon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustave_robichon/32/207522_2.png) [@gustave\_Robichon](https://discourse.julialang.org/u/gustave_Robichon)\
**Post date:** [July 9, 2024, 11:41am UTC](https://discourse.julialang.org/t/change-linear-solver-using-jump-hypatia/116306/7 "2024-07-09T11:41:23Z")

</div>

this works well :

```
   set_attribute(model , "use_dense_model",false)
   set_attribute(model, "syssolver", 
   Hypatia.Solvers.SymIndefSparseSystemSolver{Float64}())

```

“use dense model” makes a mistake, but the second line is OK (it uses less memory, but is also slower)
