2

I am using Bonmin through Pyomo/Python, on an Windows machine. Bonmin is being using via binaries, and HSL solvers as well. I could change the default solver successfully for Bonmin but IPOPT is still using MUMPS as a linear solver.

I've tried including a bonmin.opt file within the folders (Bonmin's executable or the .py file) but it is not interpreted by Pyomo.

For assigning the linear solver to Bonmin, I use the command line below:

solver.options['linear_solver'] = 'ma27'

For assigning the linear solver to IPOPT within Bonmin, I tried many different commands but could not find any that worked. Examples include:

solver.options['ipopt.linear_solver'] = 'ma27'

solver.options['ipopt_linear_solver'] = 'ma27'

As well as many other different syntax. I have searched throughout Bonmin's and IPOPT's manuals but I still get the same warning if the syntax is accepted:

NOTE: You are using Ipopt by default with the MUMPS linear solver. Other linear solvers might be more efficient (see Ipopt documentation).

Otherwise, the syntax isn't even accepted.

Do you have any suggestions?

mittmemo
  • 2,062
  • 3
  • 20
  • 27
Gebbran
  • 21
  • 2

1 Answers1

0

According to the BONMIN documentation here, if you want to set options for Ipopt (when used inside BONMIN) you have to set them in the file bonmin.opt.

Something like this could, hop

import pyomo.opt
with pyomo.opt.SolverFactory("bonmin") as solver:
    solver.options.option_file_name = "bonmin.opt"
    with open("bonmin.opt", "w") as f:
        # f.write() # Here you can specify options for BONMIN using the "bonmin." prefix
        f.write("linear_solver ma27\n") # This is the IPOPT option
    solver.solve(model)

More information about option files for IPOPT can be found here.

gmavrom
  • 430
  • 4
  • 12
  • Thanks, that was as close as I could get to have the code running with ma27 - but now I get a warning as follows. It then goes on to use MUMPS as linear solver instead of MA27. WARNING: Tried to set option "linear_solver" to a value of "ma27", but the previous value is set to disallow clobbering. The setting will remain as: "linear_solver ma27". – Gebbran Oct 26 '20 at 03:30