# Solver-dependent callbacks in JuMP -- How to do it right?

**URL:** <https://discourse.julialang.org/t/solver-dependent-callbacks-in-jump-how-to-do-it-right/32130>\
**Category:** Optimization (Mathematical)\
**Created:** [December 11, 2019, 3:30am UTC](https://discourse.julialang.org/t/solver-dependent-callbacks-in-jump-how-to-do-it-right/32130 "2019-12-11T03:30:28Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![miles.lubin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/miles.lubin/32/279_2.png) [@miles.lubin](https://discourse.julialang.org/u/miles.lubin)\
**Post date:** [December 11, 2019, 7:33pm UTC](https://discourse.julialang.org/t/solver-dependent-callbacks-in-jump-how-to-do-it-right/32130/5 "2019-12-11T19:33:46Z")

</div>

It’s by design and guaranteed that when you use `direct_model`, the indices of the variables in JuMP match the indices in the solver’s MOI wrapper. The solver’s MOI wrapper _could_ add an extra level of indirection, but I don’t think CPLEX does.

Fully agreed that solver-dependent callbacks are poorly documented and incomplete at the moment. We’re lacking contributors in this area.

---

_[View the full topic](https://discourse.julialang.org/t/solver-dependent-callbacks-in-jump-how-to-do-it-right/32130)._
