2

I am using pyomo for mixed-integer linear programming model. I call cplex in pyomo to solve the model. The problem I am solving is large, which require parallel computing.

Should I set parallel in pyomo or in cplex?

In pyomo, I found this syntax, but seems not working.

solver_manager = SolverManagerFactory('pyro')

If set parallel in cplex, how to modify this syntax? To add something calling parallel computing?

result = opt.solve(inst, tee=True, warmstart=True)

I have no idea which way to proceed..Thanks for your help!

Best, Lei

1 Answer 1

1

By default, CPLEX should already be using parallel threads. For example, in the documentation for the global thread count parameter, we have:

When this parameter is at its default setting 0 (zero), and your application includes no callbacks or only an informational callback, CPLEX can use all available threads; that is, at most 32 threads or the number of cores of the machine, whichever is smaller. If your machine offers more than 32 threads, you can take advantage of them by increasing the value of this parameter.

In the pyomo documentation here, it says:

If there are troubles with solver (i.e., after Pyomo has output "Applying Solver"), it is often helpful to use the option --stream-solver that causes the solver output to be displayed rather than trapped.

If you do that, you should see the CPLEX log output on the screen. Look for a line like this:

Parallel mode: deterministic, using up to 8 threads.

If not, maybe it gives you a clue.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, it shows parallel mode info. In other words, just leave the code alone, it directly uses parallel computing with solver CPLEX. Thanks, rkersh.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.