solver:multiple_cplex_threads

This shows you the differences between two versions of the page.

Both sides previous revision Previous revision Next revision | Previous revision | ||

solver:multiple_cplex_threads [2017/09/02 19:38] support |
— (current) | ||
---|---|---|---|

Line 1: | Line 1: | ||

- | ====== Multiple CPLEX threads ====== | ||

- | |||

- | Q: //I use CPLEX as my solver and have heard that it is possible to use multiple threads to decrease the solution time and use the full capacity of the computer. How is this implemented in GAMS?// | ||

- | |||

- | A GAMS run involves | ||

- | * the GAMS language compiler for processing the source code and data of the model and generating the model | ||

- | * and a solver for doing the optimization. | ||

- | Currently the GAMS language compiler is not able to take advantage of parallel processing but a number of the available solvers are. Moreover, the GAMS system does not impose any restrictions on the number of threads used, however, a solver may impose a restcition. | ||

- | |||

- | CPLEX uses SMP (symmetric multi processing) to work in parallel. Only some parts of the CPLEX code make use of this: branch-and-bound (for MIPs) and the barrier code (for solving LPs or the root node for MIPs). For details, please check your [[https://www.gams.com/latest/docs/S_CPLEX.html|solver manual]]. | ||

- | |||

- | |||

- | The parallel option can be specified via the GAMS option ''threads'': | ||

- | |||

- | <code> | ||

- | option threads=6; | ||

- | </code> | ||

- | |||

- | The underlying solver algorithm must support multiple threads in order for the option to take effect. For example, you can set CPLEX to use the barrier algorithm that supports parallel threads by using a solver solver specific option file, hence, you may add the following to your model: | ||

- | |||

- | <code> | ||

- | $onecho > cplex.opt | ||

- | lpmethod 4 | ||

- | $offecho | ||

- | <modelname>.optfile=1; | ||

- | </code> | ||

- | |||

- | ,where <modelname> is replaced with the name of your model. This activates the use of the solver specific option file. In general, it is possible to set the number of threads also via the solver specific option file, as well as, verify the number of threads used from the solver specific part of the GAMS log file, however, ultimately this is determined by the solver developer. | ||

- | |||

- | <code> | ||

- | Reading data... | ||

- | Starting Cplex... | ||

- | Tried aggregator 1 time. | ||

- | LP Presolve eliminated 1 rows and 1 columns. | ||

- | Reduced LP has 5 rows, 6 columns, and 12 nonzeros. | ||

- | Presolve time = 0.03 sec. (0.00 ticks) | ||

- | Parallel mode: using up to 6 threads for barrier. | ||

- | </code> | ||

IMPRESSUM / LEGAL NOTICE
PRIVACY POLICY
solver/multiple_cplex_threads.1504373928.txt.gz ยท Last modified: 2017/09/02 19:38 by support