IDAES / idaes-pse

The IDAES Process Systems Engineering Framework
https://idaes-pse.readthedocs.io/
Other
216 stars 234 forks source link

ipopt_l1 doesn't read idaes configuration #1073

Closed viiibhav closed 1 year ago

viiibhav commented 1 year ago

I am trying to use ipopt_l1 but I'm unable to make it use the options I pass to it. I'm doing something like this:

from pyomo.common.config import ConfigBlock
import idaes
from idaes.core.solvers import use_idaes_solver_configuration_defaults

use_idaes_solver_configuration_defaults()
idaes.cfg.declare("ipopt_l1", ConfigBlock(implicit=True))
idaes.cfg.ipopt_l1.declare("options", ConfigBlock(implicit=True))
idaes.cfg.ipopt_l1.options.nlp_scaling_method = "user-scaling"
idaes.cfg.ipopt_l1.options.linear_solver = "ma57"
solver = pyo.SolverFactory('ipopt_l1')

print(idaes.cfg.ipopt_l1.options.linear_solver) returns ma57 but it is not actually being used.

eslickj commented 1 year ago

I think what happens here (roughly) is that since there is no SolverFactory registered for "ipopt_l1" the solver ends up being "ASL" with sub solver "ipopt_l1". Im not sure what the best way to fix this is, but I'm leaning toward just registering a solver factory based on the ipopt one for ipopt_l1.

@jsiirola or @andrewlee94, any opinion on this?

eslickj commented 1 year ago

This should be fixed by PR #1076