How to set iteration limit in JuMP by using KNITRO solver

I use KNITRO as a nonlinear solver in JuMP, and the iteration is limited to 1e4, I want to set a new iteration limit, how to do it?

And a function that can obtain the supported attributes in JuMP could be preferred, is there a function like that? It takes me a long time to find the setting method (the keyword), and I got crazy :joy:

1 Like

For KNITRO specifically, see Knitro user options — Artelys Knitro 13.2 User's Manual

I believe (not tested) it is set as

using JuMP
import KNITRO
model = Model(KNITRO.Optimizer)

new_iter_limit = 1e6
set_optimizer_attribute(model, "maxit", new_iter_limit)