Parallel technology is used to distribute a computation across multiple CPU cores. Parallel functionality in Mathematica follows the hub-and-spoke model, where one controlling Wolfram kernel distributes work to multiple subordinate Wolfram kernels (subkernels). The subkernels can be run on local or remote computers. The main difference between a subkernel on a local computer versus a subkernel on a remote computer is how to connect to them.
Common configurations include:
- only one local computer
- several computers with a combination of operating systems
- an unmanaged Linux cluster
- a managed Linux cluster
Once the setup is configured, please refer to the Parallel Computing guide page for a list of parallel functions in Mathematica. For detailed instructions in using parallel functionality, see the Parallel Computing Tools User Guide.
A single local computer
This is the most common usage of Mathematica. Computers have multiple CPU cores, and installing Mathematica provides access to local subkernels automatically. However, some additional setup is required if the number of subkernels that launch is not equal to the number of CPU cores available. Moreover, if your computer has more CPU cores than there are Mathematica subkernels associated with your license, then you may need a Mathematica Core Extension license.
Several computers with a combination of operating systems
This setup is common to small research groups or business offices where Mathematica may already be installed on each computer. Often the computers are all on the same local subnetwork, but this is not necessary so long as the computers are visible to each other across the local network via port 3737.
Simply install and configure gridMathematica Server/Lightweight Grid Manager on each computer on which Wolfram kernels are going to run.
An unmanaged Linux cluster
This setup is common to small research groups or businesses that are most comfortable working in a Unix environment. Often the computers are all on the same local subnetwork, but this is not necessary so long as the computers are visible to each other across the local network via SSH.
Typically the computers already have Mathematica installed and are each individually licensed or licensed via Wolfram’s license manager, MathLM. If MathLM is used, then any computer running Mathematica must be able to connect to the MathLM server via ports 16286 and 16287. For details, see the System Administrator Guide.
- Install Mathematica on each computer from which you want to access remote kernels. If memory is an issue on a particular machine, then instead install gridMathematica Server as it has the smallest memory requirement, but still provides Wolfram kernels.
- Set up a remote kernel connection between the client and the host.
- On the client computer, evaluate
LaunchKernelsin a notebook or use any other parallel functionality.
Your parallel computations now automatically use the configured remote kernels.
A managed Linux cluster
This setup is common to large research universities or businesses with a dedicated Linux cluster for computation. Common cluster managers include SLURM and Torque. In a high-performance cluster, compute nodes typically have a shared or cloned file system, so Mathematica need only be installed once. Licensing of Wolfram kernels is normally handled by a separate license server running Wolfram’s license manager, MathLM. For details on setting up the license manager, please refer to our System Administrator Guide.
In this setup, all of the compute nodes need to be able to freely
- use SSH between each other without password authentication
- connect to the MathLM server via ports 16286 and 16287
Then remote Wolfram kernels are ready to be accessed by a submitted Mathematica job.