Configuring Lightweight Grid Kernels for Parallel Computation
The Wolfram Lightweight Grid Manager makes Wolfram Engines, or kernels, available over the network to use as parallel subkernels. This note discusses how to configure the parallel master kernel to use such Lightweight Grid kernels for parallel computation.
In Version 13.1 of the Wolfram System, the way these Lightweight Grid kernels are configured has changed. This document show how to discover, configure and use Lightweight Grid kernels.
There are two ways to configure kernels provided by Lightweight Grid Manager:
Specifying Machines with Lightweight Grid Manager
$DefaultKernels | list of kernel configurations to launch by default |
KernelConfiguration | detailed configuration for a parallel subkernel |
LaunchKernels | launch configured kernels |
Configuration of kernels for parallel computing.
Once you have a desired default kernel configuration, you can make it persistent, by setting an initialization value. Such a value is stored in a file in your home directory and causes the variable $DefaultKernels to be initialized in every new session.
If you ever want to revert to the default, you should remove any initialization values given.
Each Lightweight Grid Manager has a management interface, a web URL where you can monitor and configure the manager. You can directly use these management URLs as kernel configurations, in place of the lwg: URLs discussed above.
Because the http: scheme does not uniquely identify Lightweight Grid Manager, not every http: URL is recognized. The port 3737 must be given, and the path component must not be empty. Alternatively, you can specify the lwg: scheme in place of http: if you have a nondefault manager configuration.
Discovering Lightweight Grid Managers
Lightweight Grid Managers advertise themselves (much like printers do) in the local network. Using the LightweightGrid client package, you can obtain kernel configurations from these discovery results. First, find any servers on the local or remote network, then ask each one in turn for the services it offers and use these services as kernel configurations.
The discovery protocol works only on the local network. Remote Lightweight Grid Managers perform discovery in their own networks, and you can obtain these results by querying them.
Each agent may offer several services, for example, different versions of the Wolfram Engine.
You can list properties of these services to help in deciding which ones to use.
Discovered services cannot be used directly as initialization values. The recommended method is to extract the agent URLs and manually set up the desired list of $DefaultKernels.
If you ever want to revert to the default, you should remove any initialization values given.