LCSB-BioCore / COBREXA.jl

Constraint-Based Reconstruction and EXascale Analysis
http://bit.ly/COBREXA
Apache License 2.0
42 stars 8 forks source link

JUMP time limit #807

Closed exaexa closed 6 months ago

exaexa commented 7 months ago

Discussed in https://github.com/LCSB-BioCore/COBREXA.jl/discussions/806

Originally posted by @mihai-sysbio December 13, 2023:

I've seen drastically different results from Tulip and GLPK. One likely cause is the default time limits they have. In the case of GLPK, I would like to increase it, so I was looking at setting a time limit in JuMP or directly in GLPK, but I'm not sure if this is compatible with the COBREXA setup.

This should become something like

flux_balance_analysis(...; modifications=[set_time_limit(1235)])

...or so.

Thanks for the idea.

stelmo commented 7 months ago

Should be easy to do.

mihai-sysbio commented 6 months ago

Thanks for setting me down the right path with those modifications. It looks like I've gotten this to work with

increase_time_limit() = (model, opt_model) -> set_attribute(model, "TimeLimit", 5000)
flux_balance_analysis(...; modifications=[increase_time_limit()])

Perhaps then this feature isn't worth implementing, and just add this example in the documentation instead?

exaexa commented 6 months ago

Apparently there's even a solver-unspecific option for doing this with JuMP. I added an implementation of that into the next branch. Currently no plan to backport it to 1.x releases, but pls ping us if you'd use that, it's just an extra few minutes of commit juggling. :D

mihai-sysbio commented 6 months ago

Sounds good @exaexa I am happy with what I have and I am fully onboard with not back-porting this.

exaexa commented 6 months ago

OK I'll assume this as solved in 2.x and close, and add our favorite mark for code that didn't quite make it, so that we don't lose it for 1.x ...

Thanks again for reporting!