How do you specify for CPLEX to use only one thread in pyomo?
CPLEX by default uses up to 32 threads, capped by the number of processors. But how do you specify using pyomo
to only use one thread?
Assume my code already has the following:
import pyomo
cplex_solver = pyomo.opt.SolverFactory('cplex')
IBM says its CPLEX thread count parameter is called Threads
.
I tried
import pyomo
cplex_solver = pyomo.opt.SolverFactory('cplex')
cplex_solver.options['threads'] = 1
and it has successfully made CPLEX use only one thread.