Unable to use setparam for Xpress under JuMP

Team, I am trying to have Xpress report its log. When programming in Mosel I used:

setparam(“XPRS_VERBOSE”,true)

Though I have tried many different things I am unable to do this with JuMP.

This is what I have tried last:

ucf=Model(with_optimizer(Xpress.Optimizer))
setparam(ucf,XPRS_VERBOSE,true)

Any idea??

Thank you!!

See Resetting TimeLimit of Gurobi Optimizer

This section of the Xpress README suggests something like:

Model(with_optimizer(Xpress.Optimizer, VERBOSE=true))

I don’t have access to Xpress so haven’t tried this.

Thanks for the response, I am however still unable to make it work.

This is my model declaration:

ucf=Model(with_optimizer(Xpress.Optimizer))

Based on your responses I have tried all these combinations, none of them work:

#setparam(ucf,XPRS_VERBOSE,true)
#Xpress.setparam!(backend(ucf).optimizer.model.inner, “XPRS_VERBOSE”, true)
#MOI.set(ucf, MOI.setparam(XPRS_VERBOSE), 100.0);
#setparam!(ucf, (XPRS_VERBOSE, true))
#setparam!(ucf, XPRS_OUTPUTLOG, 0)
#setparam(ucf,XPRS_VERBOSE,true)
#setparam(ucf,XPRS_VERBOSE,false)

Any ideas?

The second one should work, please provide the error message as I don’t have Xpress available to test.
Note that @mlubin’s solution is definitely the simplest one.

With this wone I get:
setparam(ucf,XPRS_VERBOSE,true)
UndefVarError: setparam not defined
in top-level scope at base\none

With this wone I get:
setparam!(ucf,XPRS_VERBOSE,true)
UndefVarError: XPRS_VERBOSE not defined
in top-level scope at base\none

With this wone I get:
Xpress.setparam!(backend(ucf).optimizer.model.inner, “XPRS_VERBOSE”, true)
MethodError: no method matching setparam!(::Xpress.Model, ::String, ::Bool)
Closest candidates are:
setparam!(::Xpress.Model, !Matched::Symbol, ::Any) at C:\Users\Diego.juliapro\JuliaPro_v1.1.1.1\packages\Xpress\Jdi4R\src\xprs_params.jl:136
setparam!(::Xpress.Model, !Matched::Int32, ::Any) at C:\Users\Diego.juliapro\JuliaPro_v1.1.1.1\packages\Xpress\Jdi4R\src\xprs_params.jl:139
setparam!(::Xpress.Model, !Matched::Integer, ::Any) at C:\Users\Diego.juliapro\JuliaPro_v1.1.1.1\packages\Xpress\Jdi4R\src\xprs_params.jl:137

in top-level scope at base\none

With this wone I get:
setparam!(ucf, (XPRS_VERBOSE, true))
UndefVarError: XPRS_VERBOSE not defined
in top-level scope at base\none

With this wone I get:
ucf=Model(with_optimizer(Xpress.Optimizer, VERBOSE=true))
KeyError: key :VERBOSE not found
in top-level scope at base\none
in Model at JuMP\jnmGG\src\JuMP.jl:217
in #Model#5 at base\none
in #set_optimizer#76 at JuMP\jnmGG\src\optimizer_interface.jl:38
in at JuMP\jnmGG\src\JuMP.jl:116
in at base\none
in #Optimizer#31 at Xpress\Jdi4R\src\MOIWrapper.jl:56
in getindex at base\dict.jl:478

With this wone I get:
ucf=Model(with_optimizer(Xpress.Optimizer, XPRS_VERBOSE=true))
KeyError: key :XPRS_VERBOSE not found
in top-level scope at base\none
in Model at JuMP\jnmGG\src\JuMP.jl:217
in #Model#5 at base\none
in #set_optimizer#76 at JuMP\jnmGG\src\optimizer_interface.jl:38
in at JuMP\jnmGG\src\JuMP.jl:116
in at base\none
in #Optimizer#31 at Xpress\Jdi4R\src\MOIWrapper.jl:56
in getindex at base\dict.jl:478