Using multiple processes as workers on a single machine
Explains an application of distributed parallel MIP in multiple processes on a single machine.
Distributed parallel optimization of mixed integer programming (MIP) models has been deprecated in CPLEX 20.1.0 and will be removed in a future release.
There are situations in which you want to run all code on a single machine. For example, when you are debugging a complex application, running all code locally can be beneficial. For the purpose of this example, assume that the local environment offers 12 cores. In such a case, it can be useful to view that computer as 12 virtual machines with one core each.
To configure such an environment, you simply add a threads parameter for each virtual machine in your Virtual Machine Configuration, like this:
<machine>
<transport type=". . .">
. . .
</transport>
<param name="threads" value="1" />
</machine>
That configuration tells CPLEX to use one thread on this particular virtual machine. The deployment in this case is almost the same as in other cases, with these differences:
- If you choose message passing interface (MPI) as the transport protocol, use "localhost" as the host name for each host.
- If you choose the process transport, omit the following arguments from the command line:
- <item value="-stdio" />
- <item value="ssh" />
- <item value="hostname" />
- If you choose TCP/IP transport protocol, you need to start only one worker on
the local host. All virtual machines declared in the Virtual Machine Configuration
(that is, the configuration.vmc file) should connect to the same address, such as
localhost:12345, for example.
Such a configuration provides interesting opportunities. For example, you can use a single machine to ramp up an infinite horizon. That practice of ramping up with an infinite horizon is also known as concurrent MIP optimization. For certain hard models, concurrent MIP optimization or ramping up with an infinite horizon has been shown to improve performance, even on a single computer with multiple cores.