# JuMP CPLEX attribute error for getting CPX\_PARAM\_INTSOLLIM

**URL:** <https://discourse.julialang.org/t/jump-cplex-attribute-error-for-getting-cpx-param-intsollim/77595>\
**Category:** Optimization (Mathematical)\
**Tags:** cplex\
**Created:** [March 8, 2022, 3:51pm UTC](https://discourse.julialang.org/t/jump-cplex-attribute-error-for-getting-cpx-param-intsollim/77595 "2022-03-08T15:51:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hideakiv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hideakiv/32/22193_2.png) [@hideakiv](https://discourse.julialang.org/u/hideakiv)\
**Post date:** [March 8, 2022, 3:51pm UTC](https://discourse.julialang.org/t/jump-cplex-attribute-error-for-getting-cpx-param-intsollim/77595/1 "2022-03-08T15:51:24Z")

</div>

I am trying to get a CPLEX attribute of a model. I am using JuMP v0.21.10 and CPLEX v0.7.8.

```julia
using JuMP, CPLEX

m = Model()
set_optimizer(m, optimizer_with_attributes(CPLEX.Optimizer, "CPX_PARAM_INTSOLLIM" => 1))
get_optimizer_attribute(m, "CPX_PARAM_INTSOLLIM")

```

However, this gives me

```julia
ERROR: MethodError: Cannot `convert` an object of type Base.RefValue{Int64} to an object of type Int64
Closest candidates are:
  convert(::Type{T}, ::T) where T<:Number at number.jl:6
  convert(::Type{T}, ::Number) where T<:Number at number.jl:7
  convert(::Type{T}, ::Ptr) where T<:Integer at pointer.jl:23
  ...
Stacktrace:
 [1] cconvert(::Type{T} where T, ::Base.RefValue{Int64}) at ./essentials.jl:388
 [2] CPXsetlongparam(::CPLEX.Env, ::Int32, ::Base.RefValue{Int64}) at /home/username/.julia/packages/CPLEX/rmvSt/src/gen1210/libcpx_api.jl:1122
 [3] get(::CPLEX.Optimizer, ::MathOptInterface.RawParameter) at /home/username/.julia/packages/CPLEX/rmvSt/src/MOI/MOI_wrapper.jl:456
 [4] get(::MathOptInterface.Bridges.LazyBridgeOptimizer{CPLEX.Optimizer}, ::MathOptInterface.RawParameter) at /home/username/.julia/packages/MathOptInterface/YDdD3/src/Bridges/bridge_optimizer.jl:804
 [5] get(::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.GenericModel{Float64,MathOptInterface.Utilities.ModelFunctionConstraints{Float64}}}}, ::MathOptInterface.RawParameter) at /home/username/.julia/packages/MathOptInterface/YDdD3/src/Utilities/cachingoptimizer.jl:847
 [6] get(::Model, ::MathOptInterface.RawParameter) at /home/username/.julia/packages/JuMP/klrjG/src/JuMP.jl:1223
 [7] get_optimizer_attribute at /home/username/.julia/packages/JuMP/klrjG/src/JuMP.jl:948 [inlined]
 [8] get_optimizer_attribute(::Model, ::String) at /home/username/.julia/packages/JuMP/klrjG/src/JuMP.jl:926

```

It seems to be returning a pointer, but how can I get the integer value?

---

<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:** [March 8, 2022, 11:55pm UTC](https://discourse.julialang.org/t/jump-cplex-attribute-error-for-getting-cpx-param-intsollim/77595/2 "2022-03-08T23:55:20Z")

</div>

That looks like a bug in which we’re calling `setlongparam` instead of `getlongparam`. I’ve opened a PR to fix: [https://github.com/jump-dev/CPLEX.jl/pull/389](https://github.com/jump-dev/CPLEX.jl/pull/389)

---

<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:** [March 9, 2022, 3:41am UTC](https://discourse.julialang.org/t/jump-cplex-attribute-error-for-getting-cpx-param-intsollim/77595/3 "2022-03-09T03:41:58Z")

</div>

This is now fixed in the latest version of CPLEX.jl. Please update your packages. You’ll need CPLEX.jl v0.9.1.
