> Advanced Programming Techniques > Parallel Optimizers > Threads |
Threads |
INDEX PREVIOUS NEXT |
The ILOG CPLEX parallel optimizers are licensed for a specific maximum number of threads (that is, the number of processors applied to a given problem). The number of threads that ILOG CPLEX actually uses during a parallel optimization is the smaller of:
The global thread parameter Threads
establishes a default thread count for all parallel optimizers. Thread limits for specific optimizers can be set to values that differ from the global default (for example, by setting IloCplex::MIPThreads
). The default value of the global thread limit is 1 (one). Therefore in order for any of the CPLEX optimizers to invoke parallel threads, the user must do one of the following:
The number of threads used when running a parallel CPLEX optimizer is entirely separate from the limit on licensed uses. A typical ILOG CPLEX license permits one licensed use, that is, a single concurrent execution on one licensed computer. If the license also contains the parallel option with a thread limit of, say, four (on a machine with at least four processors), that one concurrent execution of ILOG CPLEX can employ any number of parallel threads to increase performance, up to that limit of 4. A license with the parallel option that additionally has a limit larger than one on the number of licensed uses can support that many simultaneous executions of ILOG CPLEX, each with the licensed maximum number of parallel threads. In such a case, the operating system will manage any contention for processors.
The number of parallel threads used by an ILOG CPLEX optimizer is usually controlled by ILOG CPLEX parameter settings. These settings are discussed in more detail in the sections that follow.
For example, let's assume you use ILOG CPLEX to optimize MIP models on an eight processor machine, and you have purchased an ILOG CPLEX license for four parallel threads. Then you can use the Interactive Optimizer command set threads i
, substituting values 1
through 4
for i
. You will not be able to set the thread count higher than 4
because you are licensed for a maximum of four threads.
If you set the number of threads to a value greater than the number of available processors, performance will usually degrade. If you set the number of threads to a value less than the number of processors, the remaining processors will be available for other jobs on your platform. Simultaneously running multiple parallel jobs with a total number of threads exceeding the number of processors may impair the performance of each individual process as its threads compete with one another.
The benefit of applying more threads to optimizing a specific problem varies depending on the optimizer you use and the characteristics of the problem. You should experiment to assess performance improvements and degradation when you apply more or fewer processors. For example, when you optimize the root relaxation using the barrier optimizer, there may be little or no benefit in applying more than four processors to the task. In contrast, if you use 16 processors during the MIP phase of an optimization, you may improve solution speed by a factor of 20. In such a case, you should set the parameters barrier limit threads
and mip limit threads
to different values in order to use your computing resources efficiently.
Another key consideration in setting optimizer and global thread limits is your management of overall system load.
Copyright © 1987-2003 ILOG, S.A. All rights reserved. Legal terms. | PREVIOUS NEXT |