# Solver-specific callback for custom termination rule for LP Barrier using Gurobi and JuMP

**URL:** <https://discourse.julialang.org/t/solver-specific-callback-for-custom-termination-rule-for-lp-barrier-using-gurobi-and-jump/104391>\
**Category:** Optimization (Mathematical)\
**Tags:** question, gurobi\
**Created:** [September 29, 2023, 12:30pm UTC](https://discourse.julialang.org/t/solver-specific-callback-for-custom-termination-rule-for-lp-barrier-using-gurobi-and-jump/104391 "2023-09-29T12:30:20Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![torressa](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torressa/32/202204_2.png) [@torressa](https://discourse.julialang.org/u/torressa)\
**Post date:** [October 2, 2023, 12:52pm UTC](https://discourse.julialang.org/t/solver-specific-callback-for-custom-termination-rule-for-lp-barrier-using-gurobi-and-jump/104391/8 "2023-10-02T12:52:26Z")

</div>

There’s a hack:

```julia
# Hack variable values out
for p in P
    for m in M
        col = unsafe_backend(model).variable_info[x[p, m].index].column
        colc = Cint(col - 1)
        ret = GRBgetdblattrelement(unsafe_backend(model), "X", colc, valuePdouble)
        println("x = $(x[p,m]) has value $(valuePdouble[])")
    end
end

```

But perhaps someone more knowledgeable can suggest a nicer way.

---

_[View the full topic](https://discourse.julialang.org/t/solver-specific-callback-for-custom-termination-rule-for-lp-barrier-using-gurobi-and-jump/104391)._
