Threads

The ILOG CPLEX parallel optimizers are licensed for a specific maximum number of threads (that is, the number processors applied to a given problem). The number of threads that ILOG CPLEX actually uses during a parallel optimization is the smaller of:

The notion of the number of threads used when running a parallel CPLEX optimizer is entirely separate from the limit on licensed uses. A typical 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 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 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 a CPLEX optimizer is controlled by operating system environment variables and/or CPLEX parameter settings, up to the limits found in the CPLEX license on the machine. This is discussed in more detail in the sections that follow.

Threads and Platform Considerations

Ordinarily, your operating system will make available to ILOG CPLEX as many threads as there are processors on your machine. In some cases, you can override this behavior through operating-system environment variables.

Those environment variables can be used to establish an upper limit on thread count, subject to the limit of your ILOG CPLEX parallel license.

Individual ILOG CPLEX optimizers, such as the ILOG CPLEX Barrier Optimizer, may be affected by other platform considerations. See the various parallel optimizers (MIP, nested, barrier, or simplex) for details that cover those considerations.

Example: Threads and Licensing

For example, let's assume you use ILOG CPLEX to optimize MIP models on an eight-processor machine, and you have purchased a ILOG CPLEX license for four parallel threads. Then you can use the Interactive Optimizer command set mip limit threads i, substituting values 1 through 4 for i. Even if you set an operating system environment variable to 6, you will not be able to set mip limit threads higher than 4 because you are licensed for a maximum of four threads. In contrast, if you set an operating system environment variable to 2, then you can set mip limit threads only as large as 2, and any MIP optimization you carry out will be limited to two processors because of the setting of the operating system environment variable.

Threads and Performance Considerations

If you set the number of threads to a value greater than the number of 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.

If you set an operating system environment variable to a greater value than you actually use within ILOG CPLEX with a limit threads parameter, your operating system may create idle threads that still consume system resources. If you know in advance how many threads you want to use, we recommend that you set the operating system environment variable to that number before you start ILOG CPLEX.

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 an LP relaxation, 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 simplex 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.


Previous Page: Parallel Libraries  Return to Top Next Page: Nondeterminism