opencobra / optlang

optlang - sympy based mathematical programming language
http://optlang.readthedocs.org/
Apache License 2.0
252 stars 52 forks source link

Parallelize large LP's #247

Closed freiburgermsu closed 1 year ago

freiburgermsu commented 1 year ago

Checklist

Question

Hello,

I am developing large LP's that, in the base case, require ~1.5 days to solve. Is there a means of parallelizing the optimization to leverage server/supercomputer architectures in Optlang? PuLP seems to offer some of the desired functionality, but I would prefer to stay within Optlang since it is the default environment for our COBRApy models.

Thank you :) Andrew

cdiener commented 1 year ago

You can use multiple cores if the solver backend allows it. For instance with cplex or gurobi. Is that pure LP or MILP? For LPs switching to an interior point method will also speed up optimizations a lot...

freiburgermsu commented 1 year ago

Hello!

It's an MILP, but I will remember the interior point method sluggish LP models. Thank you for reminding me that solvers handle parallelization as well. I found a nice tutorial for Gurobi.

:) Andrew

cdiener commented 1 year ago

Oh yeah, that would work for several MILPs. But you can also do something like this for a Gurobi model in optlang to parallelize a single model:

model.problem.Params.Threads = 8