Using the CPLEX distributed MIP algorithm with OPL
You can use the distributed MIP algorithm to solve a standalone OPL model from the IDE, from the OPL APIs, or from OPLScript.
Distributed MIP from the OPL IDE
Before using the distributed MIP algorithm to solve a standalone OPL model, you need to create a Virtual Machine Configuration (VMC) file to specify the machines to be used as workers for the distributed computation. The format of the VMC file is described in the CPLEX documentation: VMC file format: virtual machine configuration for distributed parallel optimization.
The distMIP example
An OPL example, distMIP, illustrates the use of distributed MIP. An example of a VMC file is provided with distMIP, and can be found in your installation of CPLEX Optimization Studio. The default installation for Windows is:
C:\Program Files\IBM\ILOG\CPLEX_Studio<version>\opl\examples\opl\distMIP
To import the distMIP model into the IDE:

The three run configurations illustrate the various ways in which the VMC file can be specified:
- including it in a settings file
- reading it with a CPLEX method
- including it in an OPLScript block
The only known limitation to the use of distributed MIP in the OPL IDE is the fact that you cannot use the MPI (Message Passing Interface) protocol.
The VMC file
Edit the file process.vmc to indicate where CPLEX Optimization Studio is installed. Replace the four occurrences of the string
$(CPLEX_STUDIO_DIR<version>) with your installation directory, for example:
C:\Program Files\IBM\ILOG\CPLEX_Studio<version>\
The edited process.vmc file looks something like this.
<vmc>
<machine name="machine1">
<transport type="process">
<cmdline>
<item value="C:/Program Files/IBM/ILOG/CPLEX_Studio1262/cplex/bin/x64_win64/cplex.exe"/>
<item value="-worker=process"/>
<item value="-libpath="C:/Program Files/IBM/ILOG/CPLEX_Studio1262/cplex/bin/x64_win64""/>
</cmdline>
</transport>
</machine>
<machine name="machine2">
<transport type="process">
<cmdline>
<item value="C:/Program Files/IBM/ILOG/CPLEX_Studio1262/cplex/bin/x64_win64/cplex.exe"/>
<item value="-worker=process"/>
<item value="-libpath="C:/Program Files/IBM/ILOG/CPLEX_Studio1262/cplex/bin/x64_win64""/>
</cmdline>
</transport>
</machine>
</vmc>
Then, from the IDE, link the VMC file to a run configuration by editing the settings (.ops) file of the project.
The settings file
The settings file life.ops is provided in the example. Click this file to open it in the editor.
In the settings editor, go to:
and enter the name and path of your CPLEX VMC file. For example:C:\Program Files\IBM\ILOG\CPLEX_Studio<version>\opl\examples\opl\distMIP\process.vmc
Save the settings file.

When you execute the run configuration of your project, OPL loads the specified VMC file into CPLEX. The VMC file indicates that CPLEX must use distributed parallel MIP with the machines specified in the file. Distributed parallel MIP is invoked only if the model to be solved is a MIP.
It is preferable to specify an absolute path to the VMC file in the settings editor. Otherwise, CPLEX may not be able to find your VMC file, depending on how and where the project is executed.
Instead of using a settings file in the IDE, you can specify the VMC file in an OPLScript execute block at the beginning of the model file.
Documentation
For detailed information about the distributed MIP algorithm and transport protocols, refer to the CPLEX document: Solving a MIP with distributed parallel optimization.
Distributed MIP from the APIs and OPLScript
You can use the distributed MIP from all the OPL APIs (C++, Java, .NET) and from OPLScript.
Several examples named distMIP are available from the OPL example libraries to show how to use the distributed MIP. These examples can be found in your installation directory, for example:
C:\Program Files\IBM\ILOG\CPLEX_Studio<version>\opl\examples\opl_interfaces
The methods readVMConfig, hasVMConfig, delVMConfig and copyVMConfig are available in C++, Java, .NET (from the CPLEX C++ library, OPL jar and OPL .NET DLL), and in OPLScript.
To make these examples run, only the paths to the VMC file and the path to the CPLEX libraries in these VMC files need to be updated.
To learn how to use the methods, see the CPLEX document: Solving a MIP with distributed parallel optimization.
Refer to the User's Manual for CPLEX for information about how to use the MPI transport protocol with distMIP. For example: Transport types for the remote object: MPI.