This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

$KernelID

$KernelID
is a unique ID number assigned to each running parallel kernel.
  • The value of $KernelID for the master kernel is .
  • 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.
Obtain the ID value of each running parallel kernel:
Obtain the ID value of each running parallel kernel:
In[1]:=
Click for copyable input
Out[1]=
$KernelID on the master kernel gives 0:
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:
Kernel ID values are not necessarily contiguous:
New in 7