LaunchKernels

LaunchKernels[]

launches all currently configured parallel subkernels.

LaunchKernels[n]

launches n local subkernels on the current computer.

LaunchKernels[ker]

launches the kernel specified by ker.

LaunchKernels[{ker1,ker2,}]

launches the kernels keri.

Details

  • Additional configurations for kernels on remote machines can be made available with the Wolfram Lightweight Grid and the Cluster Integration Package.

Examples

open allclose all

Basic Examples  (1)

Launch the default kernels:

Close all running kernels and start two new ones:

Scope  (2)

Launch the default kernels as described in $ConfiguredKernels:

Launch two more local kernels, in addition to those already running:

Generalizations & Extensions  (1)

Close all kernels:

Launch copies of the previously running kernels:

Applications  (1)

Measure the speedup of the same calculation with different numbers of kernels used:

Properties & Relations  (1)

Distributed definitions and shared variables apply to running kernels and new ones:

Packages read with ParallelNeeds also apply to running and new kernels:

Close all running kernels and launch new ones:

The new kernels inherit previously distributed definitions and shared variables:

The new kernels also inherit packages read previously:

Possible Issues  (4)

If any kernels are already running, LaunchKernels[] does not launch the default kernels:

Close all running kernels, then launch the default set of kernels:

Kernels may be automatically launched when first needed:

Manually close the kernels:

Now, no kernels are launched automatically:

If no kernels are available, most parallel calculations are done sequentially:

No kernels are launched by default on a single-core computer:

Specify the number of desired kernels to launch them anyway:

Introduced in 2008
 (7.0)