CloseKernels

CloseKernels[]

terminates all parallel kernels from the list Kernels[].

CloseKernels[k]

terminates the kernel k.

CloseKernels[{k1,k2,}]

terminates the kernels k1, k2, .

Details

  • Kernels can be specified either using KernelObject, as returned by Kernels[], or using their integer IDs, as returned by $KernelID.
  • Closed kernels are removed from the list of kernels available for parallel computing, as given by Kernels[].

Examples

open allclose all

Basic Examples  (1)

Close all running parallel kernels:

Scope  (2)

Close any parallel kernels that may be running and launch the default kernels:

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  (1)

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

Wolfram Research (2008), CloseKernels, Wolfram Language function, https://reference.wolfram.com/language/ref/CloseKernels.html.

Text

Wolfram Research (2008), CloseKernels, Wolfram Language function, https://reference.wolfram.com/language/ref/CloseKernels.html.

CMS

Wolfram Language. 2008. "CloseKernels." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CloseKernels.html.

APA

Wolfram Language. (2008). CloseKernels. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CloseKernels.html

BibTeX

@misc{reference.wolfram_2023_closekernels, author="Wolfram Research", title="{CloseKernels}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/CloseKernels.html}", note=[Accessed: 18-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_closekernels, organization={Wolfram Research}, title={CloseKernels}, year={2008}, url={https://reference.wolfram.com/language/ref/CloseKernels.html}, note=[Accessed: 18-March-2024 ]}