plasmo-dev / Plasmo.jl

A Platform for Scalable Modeling and Optimization
Other
143 stars 20 forks source link

Using a solver other than Ipopt #70

Closed nazir-nawaf closed 1 year ago

nazir-nawaf commented 1 year ago

Hi, I've just started to use Plasmo.jl and have been going through some of the example code. My issue is that when I try to use a solver other than Ipopt, I get the following error:

LoadError: MathOptInterface.GetAttributeNotAllowed{MathOptInterface.NLPBlockDual}: Getting attribute MathOptInterface.NLPBlockDual(1) cannot be performed: Gurobi.Optimizer does not support getting the attribute MathOptInterface.NLPBlockDual(1). You may want to use a CachingOptimizer in AUTOMATIC mode or you may need to call reset_optimizer before doing this operation if the CachingOptimizer is in MANUAL mode.

In this case I'm trying to use Gurobi, but I get this error with every solver, even GLPK. Can you please help me out on what I'm doing wrong?

jalving commented 1 year ago

Hi @nazir-nawaf. This should be fixed with the latest release. Can you try updating Plasmo.jl and re-testing?

nazir-nawaf commented 1 year ago

Hi @jalving. Yes it's working now. Thank you!!