Pyomo / pyomo

An object-oriented algebraic modeling language in Python for structured optimization problems.
https://www.pyomo.org
Other
1.92k stars 498 forks source link

Solver 'baron' is not recognized by NEOS. #2040

Closed jj314 closed 1 year ago

jj314 commented 3 years ago

Summary

I was trying to solve a model with baron on the neos server. Unexpectedly I get an error about neos not knowing about baron. Below is a minimal code sample for reproducing the issue.

# issue.py
from pyomo import environ as pym
import os
os.environ['NEOS_EMAIL'] = 'email@address'
model = pym.ConcreteModel()
model.x = pym.Var()
model.OBJ = pym.Objective(expr=model.x)
solver_manager = pym.SolverManagerFactory('neos')
results = solver_manager.solve(model, opt='baron')

Error Message

$ python issue.py
Traceback (most recent call last):
  File "issue.py", line 8, in <module>
    results = solver_manager.solve(model, opt='baron')
  File "D:\Programs\Python\Python37\lib\site-packages\pyomo\opt\parallel\async_solver.py", line 28, in solve
    return self.execute(*args, **kwds)
  File "D:\Programs\Python\Python37\lib\site-packages\pyomo\opt\parallel\manager.py", line 118, in execute
    ah = self.queue(*args, **kwds)
  File "D:\Programs\Python\Python37\lib\site-packages\pyomo\opt\parallel\manager.py", line 133, in queue
    return self._perform_queue(ah, *args, **kwds)
  File "D:\Programs\Python\Python37\lib\site-packages\pyomo\neos\plugins\kestrel_plugin.py", line 129, in _perform_queue
    % (solver_name, str(sorted(self._solvers.keys()))))
pyomo.opt.parallel.manager.ActionManagerError: Solver 'baron' is not recognized by NEOS. Solver names recognized:
['bonmin', 'cbc', 'conopt', 'couenne', 'cplex', 'filmint', 'filter', 'ipopt', 'knitro', 'l-bfgs-b', 'lancelot', 'lgo', 'loqo', 'minlp', 'minos', 'minto', 'mosek', 'ooqp', 'path', 'raposa', 'snopt']

Information on your system

Pyomo version: 6.0.1 Python version: 3.7.3 Operating system: Windows 10 How Pyomo was installed: PyPI Solver (if applicable): BARON

jsiirola commented 3 years ago

Pyomo interfaces with NEOS using NEOS's Kestrel/NL interface. Currently, NEOS does not support Baron through the Kestrel/NL interface. NEOS does support Baron through the GAMS interface. In theory the Pyomo interface could be extended to leverage the GAMS model writer and thereby support for solvers through Kestrel/GAMS.

Pull requests are always welcome.