Julia with Knitro

Hey everyone! I’m trying to set a time limit and a gap in Julia using Knitro, but not having success:

m = Model(KNITRO.Optimizer)
set_optimizer_attribute(m, “maxtime_cpu”, 3.6e+2)
set_optimizer_attribute(m, “mip_opt_gap_abs”, 1.0e+0)

ERROR: MathOptInterface.UnsupportedAttribute

Does anyone know how to set these parameters?

Thanks in advance!

Hello and welcome. I’ve moved this to the Optimization area to get more :eyes: on it.

This specifically can be set using a function from JuMP itself:
set_time_limit_sec(m, 3.6e+2)
where the value is in seconds.

ERROR: MathOptInterface.UnsupportedAttribute

What is the full error? Does it happen with maxtime_cpu or mip_opt_gap_abs?


I tried to do it this way, but the runtime remains longer than what was set in parameter :frowning:

Sorry! It’s just happening with the maxtime_cpu. For mip_opt_gap_abs, model processing is not interrupted when it reaches the established gap.