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

Lei
  • 21
  • 1

1 Answers1

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.

rkersh
  • 4,447
  • 2
  • 22
  • 31
  • Yes, it shows parallel mode info. In other words, just leave the code alone, it directly uses parallel computing with solver CPLEX. Thanks, rkersh. – Lei Sep 25 '17 at 08:12