launches all currently configured parallel subkernels.
launches n local subkernels on the current computer.
LaunchKernels[ker]
launches the kernel specified by ker.
LaunchKernels[{ker1,ker2,…}]
launches the kernels keri.
LaunchKernels
launches all currently configured parallel subkernels.
launches n local subkernels on the current computer.
LaunchKernels[ker]
launches the kernel specified by ker.
LaunchKernels[{ker1,ker2,…}]
launches the kernels keri.
Details and Options
- LaunchKernels[] uses $DefaultParallelKernels to determine the list of kernels to launch.
- LaunchKernels[] (no arguments) launches the default kernels only if no kernels are currently running.
- The following kernel specifications are recognized:
-
"ssh://user@hostname:port/path" a kernel on the given machine, accessed using SSH "ssh://hostname" use the default path, user and port on the given machine "hostname" equivalent to "ssh://hostname" "wstp://server:port/pool" a kernel on a WSTPServer "wstp://server" use the default port and kernel pool "Local" the default local kernel "localhost" a kernel on the same machine n n local parallel kernels "file:///path/to/wolfram" the given kernel on the same machine "file://" the default kernel on the same machine "https://www.wolframcloud.com/" a kernel in the Wolfram Cloud "lwg://host.example.com:port/path" a kernel on a LightweightGrid server "lwg://host.example.com:port" use the default path to the LightweightGrid manager "lwg://host.example.com" use the default port (3737) of the LightweightGrid server LinkObject[…] a WSTP link to a running kernel - Additional configurations for kernels on remote machines can be made available with the Wolfram Lightweight Grid and the Cluster Integration Package.
- The ProgressReporting option specifies whether to report the progress of kernel launching.
- The default value is ProgressReporting:>$ProgressReporting.
Examples
open all close allBasic Examples (4)
LaunchKernels[]Close any running kernels and launch the default local kernels only:
CloseKernels[];LaunchKernels["Local"];$KernelCountClose all running kernels and start 12 local kernels:
CloseKernels[]; LaunchKernels[12];$KernelCountLaunchKernels by default displays information about its progress:
LaunchKernels[{"ssh://andromeda/?64", 24, "ssh://vega/?4"}];
| |
Scope (13)
Kernel Specifications (4)
Launch the default kernels as described in $DefaultParallelKernels:
$DefaultParallelKernelsLaunchKernels[]Launch two more local kernels, in addition to those already running:
$KernelCountLaunchKernels[2]Kernels[]Launch kernels on a remote machine:
LaunchKernels["ssh://prokyon?2"]Use KernelConfiguration to specify additional details of the desired kernels:
LaunchKernels[KernelConfiguration["localhost", "KernelCommand" -> "wolfram141", "KernelCount" -> 4]]ParallelEvaluate[{First[$CommandLine], $Version}]Local Kernels (3)
Use a specific local kernel, given by its absolute path:
LaunchKernels["file:///usr/local/bin/wolfram141?4"]Alternatively, specify the properties with KernelConfiguration:
LaunchKernels[KernelConfiguration["localhost", "KernelCommand" -> "/usr/local/bin/wolfram141", "KernelCount" -> 2]]For local kernels, the default number of parallel kernels is equal to $ProcessorCount, license permitting:
KernelConfiguration["Local"]["KernelCount"]$ProcessorCountSSH Kernels (3)
Give the path to the remote kernel and number of kernels as URL parameters:
LaunchKernels["ssh://prokyon//usr/local/bin/wolfram140?4"]Alternatively, specify the path and kernel count as properties of KernelConfiguration:
LaunchKernels[KernelConfiguration["ssh://prokyon", "KernelCommand" -> "/usr/local/bin/wolfram140", "KernelCount" -> 4]]Specify the remote operating system to automatically choose a suitable kernel command:
LaunchKernels[KernelConfiguration["ssh://mac.example.com", "OperatingSystem" -> "MacOSX", "KernelCount" -> 4]]ParallelEvaluate[First[$CommandLine], First[Kernels[]]]When using a URL short form, the number of parallel kernels can be specified with "?n":
LaunchKernels["ssh://andromeda?64"];$KernelCountWSTPServer Kernels (1)
LWG Kernels (1)
Generalizations & Extensions (1)
Options (2)
ProgressReporting (2)
Do not show a temporary progress report:
LaunchKernels[24, ProgressReporting -> False];Show a progress report even if the default $ProgressReporting may be False:
LaunchKernels["ssh://andromeda/?64", ProgressReporting -> True];
| |
Applications (1)
Properties & Relations (1)
Distributed definitions and shared variables apply to running kernels and new ones:
n = 17; DistributeDefinitions[n];
xs = 0;SetSharedVariable[xs];ParallelEvaluate[{n, xs++}]Packages read with ParallelNeeds also apply to running and new kernels:
ParallelNeeds["ComputerArithmetic`"]Close all running kernels and launch new ones:
CloseKernels[];LaunchKernels[]The new kernels inherit previously distributed definitions and shared variables:
ParallelEvaluate[{n, xs++}]The new kernels also inherit packages read previously:
ParallelEvaluate[$ContextPath, First[Kernels[]]]Possible Issues (3)
If any kernels are already running, LaunchKernels[] does not launch the default kernels:
$KernelCountLaunchKernels[]Close all running kernels, then launch the default set of kernels:
CloseKernels[];LaunchKernels[]Kernels may be automatically launched when first needed:
$KernelCountParallelTable[Prime[i], {i, 10}]$KernelCountCloseKernels[];Now, no kernels are launched automatically:
ParallelTable[Prime[i], {i, 10}]If no kernels are available, most parallel calculations are done sequentially:
CloseKernels[];ParallelTable[Prime[i], {i, 5}]Neat Examples (1)
Specify a kernel on a remote machine:
threadripper = KernelConfiguration["ssh://andromeda"]Ask it for the number of processor cores:
RemoteEvaluate[threadripper, $ProcessorCount]Update the kernel specification with the kernel number returned:
threadripper = KernelConfiguration[threadripper, "KernelCount" -> %]Information[threadripper]LaunchKernels[threadripper];$KernelCountHistory
Text
Wolfram Research (2008), LaunchKernels, Wolfram Language function, https://reference.wolfram.com/language/ref/LaunchKernels.html.
CMS
Wolfram Language. 2008. "LaunchKernels." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/LaunchKernels.html.
APA
Wolfram Language. (2008). LaunchKernels. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LaunchKernels.html
BibTeX
@misc{reference.wolfram_2026_launchkernels, author="Wolfram Research", title="{LaunchKernels}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/LaunchKernels.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_launchkernels, organization={Wolfram Research}, title={LaunchKernels}, year={2008}, url={https://reference.wolfram.com/language/ref/LaunchKernels.html}, note=[Accessed: 13-June-2026]}