# How to specify barrier method to use?

**URL:** <https://discourse.julialang.org/t/how-to-specify-barrier-method-to-use/81290>\
**Category:** Optimization (Mathematical)\
**Tags:** jump, optimization\
**Created:** [May 18, 2022, 11:46pm UTC](https://discourse.julialang.org/t/how-to-specify-barrier-method-to-use/81290 "2022-05-18T23:46:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Popeye](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/popeye/32/25244_2.png) [@Popeye](https://discourse.julialang.org/u/Popeye)\
**Post date:** [May 18, 2022, 11:46pm UTC](https://discourse.julialang.org/t/how-to-specify-barrier-method-to-use/81290/1 "2022-05-18T23:46:11Z")

</div>

I am trying to use the barrier method using Xpress solver, but I have not been able to find the right option/attribute anywhere. The Julia wrapper for Xpress doesn’t have much documentation. The official documentation states that “The barrier solver can be invoked on a problem by using the ‘b’ flag with [XPRSlpoptimize]”, but I am unsure as how to use it with JuMP: [Solution Methods (fico.com)](https://www.fico.com/fico-xpress-optimization/docs/latest/solver/optimizer/HTML/chapter4.html)

Does anyone know?

---

<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:** [May 18, 2022, 11:57pm UTC](https://discourse.julialang.org/t/how-to-specify-barrier-method-to-use/81290/2 "2022-05-18T23:57:18Z")

</div>

I don’t have Xpress installed so I can’t test this, but try:

```julia
model = Model(Xpress.Optimizer)
set_optimizer_attribute(model, "MOI_SOLVE_MODE", "b")

```

(This isn’t documented, so I opened an issue: [Document MOI-specific parameters · Issue #168 · jump-dev/Xpress.jl · GitHub](https://github.com/jump-dev/Xpress.jl/issues/168))

---

<div class="post-metadata">

**Author:** ![Popeye](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/popeye/32/25244_2.png) [@Popeye](https://discourse.julialang.org/u/Popeye)\
**Post date:** [May 19, 2022, 12:01pm UTC](https://discourse.julialang.org/t/how-to-specify-barrier-method-to-use/81290/3 "2022-05-19T12:01:25Z")

</div>

That works, thank you  
The Julia wrapper to Xpress seems to be slow and even Clp runs faster for me.

---

<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:** [May 19, 2022, 7:12pm UTC](https://discourse.julialang.org/t/how-to-specify-barrier-method-to-use/81290/4 "2022-05-19T19:12:50Z")

</div>

Please provide a reproducible example, but perhaps do so in a new post so this one is easily found by people searching in the future.

---

<div class="post-metadata">

**Author:** ![Popeye](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/popeye/32/25244_2.png) [@Popeye](https://discourse.julialang.org/u/Popeye)\
**Post date:** [May 21, 2022, 9:57pm UTC](https://discourse.julialang.org/t/how-to-specify-barrier-method-to-use/81290/5 "2022-05-21T21:57:05Z")

</div>

> [@odow](#):
>
> Please provide a reproducible example,

I have run into another problem, which is more to do with JuMP than Xpress. For a pure linear program with 20001 rows and 40001 columns, it was taking about 30 minutes to build the JuMP model/ or before the solve process begins. I wrote the model to a MPS file and the file turned out to be 13.4GB! I understand that the problem is dense, but can we really expect a file of that size for a problem with 20001 rows and 40001 columns? I will try to put together a reproducible example.

---

<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:** [May 21, 2022, 11:55pm UTC](https://discourse.julialang.org/t/how-to-specify-barrier-method-to-use/81290/6 "2022-05-21T23:55:00Z")

</div>

> it was taking about 30 minutes to build the JuMP model  
> the file turned out to be 13.4GB!

Both of those things are very unusual. Do you have a reproducible example?

> I understand that the problem is dense

But ah. This means you have `800_060_001` non-zeros. Just to store that many `Float64` coefficients requires 6 GB of memory. But JuMP assumes problems are sparse, so there will be significant overhead for storing dense problems. In which case, it might not be surprising that it takes that long and consumes so much memory.

Why is your problem dense?

---

<div class="post-metadata">

**Author:** ![Popeye](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/popeye/32/25244_2.png) [@Popeye](https://discourse.julialang.org/u/Popeye)\
**Post date:** [May 22, 2022, 11:39pm UTC](https://discourse.julialang.org/t/how-to-specify-barrier-method-to-use/81290/7 "2022-05-22T23:39:03Z")

</div>

> [@odow](#):
>
> Both of those things are very unusual. Do you have a reproducible example?

I will add example in a separate post.

> [@odow](#):
>
> Why is your problem dense?

It is output of a simulation of many possible values over which I am optimizing. I don’t know if there is a way of making it sparse.
