Using a process transport protocol with distributed parallel MIP
Shows how to run distributed parallel MIP with a process transport protocol.
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.
This topic shows how to run distributed parallel MIP optimization with a process as the transport protocol to manage communication between the master and workers. Specifically, this example uses a secure shell (ssh) for the master to connect to the workers. For simplicity, the example assumes that this secure shell has been set up to use no password on the remote machines.
Prerequisites
- Your CPLEX installation
- A network share or other network file-sharing system, such as Network File System (NFS), accessible for all the machines, both master and workers, that you plan to use; for clarification about this prerequisite, see Before you begin, especially the point about a "network share" not being a hard requirement.
Procedure
The procedure for using a process transport protocol for communication is slightly
simpler than for using a message passing transport protocol since you do not need to
declare a message passing cluster. However, the declarations in the Virtual Machine
Configuration file configuration.vmc are more detailed.
Find the
binfolder or directory of your CPLEX installation.Put the
cplexbinary file and object files (that is, all files in thebinfolder or directory) on the accessible network share. On many platforms, the object files are designated by the.sofile extension. On Windows platforms, these equivalent files are designated by the.dllfile extension. On MacOS, the suffix is.dyld.For the purpose of this example, all the files from the
bindirectory of your CPLEX installation are now in/nfs/CPLEX.Create a Virtual Machine Configuration file,
configuration.vmc, to define the available workers. Here is a sample of such a file for a secure shell as the process.<?xml version="1.0"?> <vmc> <machine name="host2"> <transport type="process"> <cmdline> <item value="ssh"/> <item value="host2"/> <item value="/nfs/CPLEX/cplex"/> <item value="-worker=process"/> <item value="-stdio"/> <item value="-libpath=/nfs/CPLEX"/> </cmdline> </transport> </machine> <machine name="host3"> <transport type="process"> <cmdline> <item value="ssh"/> <item value="host3"/> <item value="/nfs/CPLEX/cplex"/> <item value="-worker=process"/> <item value="-stdio"/> <item value="-libpath=/nfs/CPLEX"/> </cmdline> </transport> </machine> </vmc>- On the master (
host1in this example), start a session in the CPLEX Interactive Optimizer. - In your interactive session, execute the command to read the configuration file that
you created.
CPLEX> read configuration.vmcAfter that
readcommand, CPLEX is set up for solving distributed parallel MIP models. Still in your interactive session, enter a model or read it from a file, and then solve it, like this:
CPLEX> read model.lp CPLEX> mipopt- All the usual commands of the Interactive Optimizer are available to access and analyze your results.