Solving optimisation sub-instances in Parallel, using Pyomo ( Traceback )

511 views Asked by At

I am trying to solve an energy model with Benders Decomposition.

In the model we are creating a master model and several sub models.

And I want to solve the sub models in parallel, and I saw an example here.

This is what I am using in the code:

from pyomo.opt.base import SolverFactory
from pyomo.opt.parallel import SolverManagerFactory
from pyomo.opt.parallel.manager import solve_all_instances

subs = []
for m in range(0, len(supportsteps)-1):
    subs.append(urbs.create_model(data,
                        range(supportsteps[m], supportsteps[m+1]+1),
                        supportsteps, type=1))

solver_manager = SolverManagerFactory("pyro")

solve_all_instances(solver_manager, 'gurobi', subs)

Which gives an error:

enter image description here Error Message

So what I am doing wrong?

Or, is it not possible to solve them in parallel?

1

There are 1 answers

1
Qi Chen On BEST ANSWER

The error message that you're seeing means that SolverManagerFactory("pyro") gave you None. It's possible that pyro isn't installed or on your PATH.

Try installing the Pyomo extras: conda install -c conda-forge pyomo.extras or pyomo install-extras