jump-dev / JuMP.jl

Modeling language for Mathematical Optimization (linear, mixed-integer, conic, semidefinite, nonlinear)
http://jump.dev/JuMP.jl/
Other
2.21k stars 393 forks source link

Large optimization models #1940

Closed harshangrjn closed 5 years ago

harshangrjn commented 5 years ago

https://github.com/lanl-ansi/MINLPLib.jl/blob/master/instances/minlp/mbtd.jl When I load the above MINLP in to JuMP, it throws the following error:

ERROR: LoadError: syntax: invalid syntax (memory-error out of gc handles)

But after deleting constraints from lines 35 through 44, it loads fine in JuMP. Is this because these constraints are just too long/big for JuMP to be able to load it into the memory? If so, any fix suggestions will be helpful.

ndinsmore commented 5 years ago

@harshangrjn I would guess that is a Julia issue rather than a JuMP issue.

For the very large constraints try breaking them into smaller expressions when parsing then add them together into one expression.

ndinsmore commented 5 years ago

I turned that script into normal julia and it seems to parse so that would make my first thought wrong.

I would still consider breaking the constraints into smaller expressions.

harshangrjn commented 5 years ago

@odow Any suggestions?

odow commented 5 years ago

Not in the near term. Make script to re-write the Julia files/edit by hand? I would do what @ndinsmore suggests and break up the long expression into multiple @NLexpressions.

mlubin commented 5 years ago

IIRC we discussed this with @kaarthiksundar in the gitter channel. We recommended using MathOptFormat to store models. JuMP was not designed to handle machine-generated models like this.

mlubin commented 5 years ago

We don't have any plans to improve macro behavior on machine-generated code. You can use the raw expression input format or MathOptFormat.