micom-dev / micom

Python package to study microbial communities using metabolic modeling.
https://micom-dev.github.io/micom
Apache License 2.0
89 stars 18 forks source link

Increase the number of threads for grow for a single model #161

Closed PathogeNish closed 7 months ago

PathogeNish commented 7 months ago

Checklist

Is your feature related to a problem? Please describe it.

I want to be able to increase the number of threads allowed in the grow function. It seems that the number of threads assigned to the growth of a single model (community model from a single sample) is fixed at 1. The threads option is used only when the model folder has multiple models.

Describe the solution you would like.

Since the grow function can take upto 20 minutes for a solver to converge on a solution, I would like to be able to parallelise the grow process for individual models in order to speed up solve time and optimise system usage since running a single model engages only 1 thread, leaving the others unused.

cdiener commented 7 months ago

In theory it is possible for some solvers (like CPLEX or GUROBI) by changing the parameters of the solver itself but single model FBA can not be parallelized very efficiently so wou would not see much gains there. If a single model takes that long it might be an issue with the solver. This should be fast with CPLEX or Gurobi.

PathogeNish commented 7 months ago

Understood. Thanks @cdiener! 😄