$KernelCount

$KernelCount

gives the number of subkernels available for parallel computations.

Details

  • $KernelCount is equivalent to Length[Kernels[]].
  • When evaluated in a subkernel of a particular master kernel, $KernelCount gives the number of subkernels available to the master kernel.

Examples

open allclose all

Basic Examples  (1)

Applications  (1)

Run a search for a random prime on each parallel kernel:

Properties & Relations  (1)

$KernelCount is effectively a shared variable:

Introduced in 2008
 (7.0)