$KernelID

$KernelID

is a unique ID number assigned to each running parallel kernel.

Details

  • The value of $KernelID for the master kernel is 0.
  • The value of $KernelID for each subkernel is a distinct positive integer, assigned when the kernel is launched.
  • Values of $KernelID are unique but not necessarily contiguous.

Examples

open allclose all

Basic Examples  (1)

Obtain the ID value of each running parallel kernel:

Generalizations & Extensions  (1)

$KernelID on the master kernel gives 0:

Properties & Relations  (3)

The output form of a kernel object indicates its $KernelID:

Newly launched kernels get new ID values:

When copying (cloning) kernels, ID values are reused, if possible:

Possible Issues  (1)

Kernel ID values are not necessarily contiguous:

Introduced in 2008
 (7.0)