Multithreading Box |
The Multithreading box on the General Solver tab:
gives you control over LINGO's use of multithreading. With multithreading, LINGO's model generator and its solvers can utilize multiple processors to improve performance.
The Threads option controls the maximum number of threads, or processors, to utilize at any given time. Interesting settings for the thread count are:
• | Max Available — LINGO determines the number of processors on the system and sets the thread limit to this number. |
• | 1 — Only one processor will be used, causing LINGO to run in single-threaded mode. |
• | N — Here, N is some positive integer greater than 1, and LINGO will set the maximum number of threads to N. |
LINGO defaults to running in single-threaded mode with a thread limit of 1.
The second option in the Multithreading box is Mode, which controls the multithreading mode that LINGO operates in. LINGO offers multicore extensions to its model generator and solvers. The multicore extensions are of two types: concurrent and parallel. Concurrent algorithms run two or more different serial algorithms on multiple copies of the same model, using a separate thread for each algorithm, terminating as soon as the winner thread finishes. These “different algorithms” may in fact be the same algorithm type, but using different strategies and/or parameters. Parallel algorithms, on the other hand, parallelize computationally intensive portions of the serial algorithm to distribute the workload across multiple threads.
The following multicore extensions are currently available in LINGO:
LINGO Component |
Model Class |
Parallel Option |
Concurrent Option |
Barrier Solver |
Linear Programs |
Yes |
No |
BNP Solver |
Mixed Integer Programs |
Yes |
No |
Global Solver |
Nonlinear Programs |
Yes |
No |
Integer Solver |
Mixed Integer Programs |
Yes |
Yes |
Linear Solver |
Linear Programs |
No |
Yes |
Model Generator |
All |
Yes |
No |
Multistart Solver |
Nonlinear Programs |
Yes |
No |
Stochastic Solver |
Stochastic Programs |
Yes |
No |
The available settings for the Mode, or multithreading mode, parameter are as follows:
• | Solver Decides — The best available multithreading strategy, either parallel or concurrent, will be selected for each step of the solution process. |
• | Off in Solver — Multithreading will be disabled in the solvers, but allowed in the model generator if the number of threads is greater than 1. |
• | Prefer Parallel — If a parallel option is available for a particular solution step, then it will be selected, otherwise, a concurrent option will be selected when available. |
• | Parallel Only - If a parallel option is available for a particular solution step, then it will be selected, otherwise, the step will be executed in single-thread mode. |
• | Prefer Concurrent - If a concurrent option is available for a particular solution step, then it will be selected, otherwise, a parallel option will be selected when available. |
• | Concurrent Only - If a concurrent option is available for a particular solution step, then it will be selected, otherwise, the step will be executed in single-thread mode. |
Note: | If the maximum thread count parameter, Threads, is set to 1, then the multithreading mode setting will be ignored, and LINGO will execute in single-threaded mode. |
Note: | Setting the maximum thread count parameter, Threads, to N does not guarantee than N cores will be fully utilized throughout the entire solve. There may be serial sections inside parallel code that get executed from time to time, causing only one core to be utilized. Concurrent algorithms may also have fewer than N different serial algorithms to launch, meaning fewer than N cores will be occupied. |