Search code examples
python-3.xoptimizationmathematical-optimizationpyomononlinear-optimization

Unknown keyword "mumps_mem_percent"


I am using Pyomo to model an optimization problem. I am getting an error if I tried to set the value of "mumps_mem_percent" option.

opt = pyo.SolverFactory('ipopt')
opt.options['mumps_mem_percent'] = 10e3
opt.solve(mdl)

RROR: Solver (ipopt) returned non-zero return code (1) ERROR: Solver log: Ipopt 3.11.1: Unknown keyword "mumps_mem_percent"

Am I doing something wrong? I checked the options of IPOPT and I found this option. Any suggestions


Solution

  • I think what you have to do is create an ipopt.opt file, which specifies the desired options, and place it in your working directory. For instance, for your case, something like this could work (found the solution here, but did not test it though):

    with pyo.SolverFactory("ipopt") as opt:
        opt.options.option_file_name = "ipopt.opt"
        with open("ipopt.opt", "w") as f:
            f.write("mumps_mem_percent 10e3\n")
        opt.solve(mdl)
    

    More information about option files for IPOPT can be found here: https://coin-or.github.io/Ipopt/OPTIONS.html

    Alternatively, someone on Github, also mentioned that using the "OF_" prefix with your options could work.