現在設定されているすべての並列サブカーネルを起動する.
現行コンピュータ上の n 個のローカルサブカーネルを起動する.
LaunchKernels[ker]
ker で指定されたカーネルを起動する.
LaunchKernels[{ker1,ker2,…}]
カーネル keri(複数)を起動する.
LaunchKernels
現在設定されているすべての並列サブカーネルを起動する.
現行コンピュータ上の n 個のローカルサブカーネルを起動する.
LaunchKernels[ker]
ker で指定されたカーネルを起動する.
LaunchKernels[{ker1,ker2,…}]
カーネル keri(複数)を起動する.
詳細とオプション
- LaunchKernels[]は$DefaultParallelKernelsを使って起動するカーネルのリストを決定する.
- LaunchKernels[](引数なし)は,実行中のカーネルがない場合にのみデフォルトのカーネルを起動する.
- 次は,認識されるカーネル指定である.
-
"ssh://user@hostname:port/path" SSHを使ってアクセスできる,指定されたマシン上のカーネル "ssh://hostname" 指定されたマシン上のデフォルトのパス "hostname" "ssh://hostname"に等しい "wstp://server:port/pool" WSTPServer上のカーネル "wstp://server" デフォルトのポートとカーネルプールを使う "Local" デフォルトのローカルカーネル "localhost" 同一マシン上のカーネル n n 個のローカル並列カーネル "file:///path/to/wolfram" 同一マシン上の指定されたカーネル "file://" 同一マシン上のデフォルトカーネル "https://www.wolframcloud.com/" Wolfram Cloud内のカーネル "lwg://host.example.com:port/path" LightweightGridサーバ上のカーネル "lwg://host.example.com:port" LightweightGridマネージャへのデフォルトパスを使う "lwg://host.example.com" LightweightGridサーバのデフォルトポート(3737)を使う LinkObject[…] 実行中のカーネルへのWSTPリンク - リモートマシンのカーネルの追加的な設定は,Wolfram Lightweight GridとCluster Integration Packageで使用できるようにすることができる.
- ProgressReportingオプションは,カーネル起動の進捗レポートを行うかどうかを指定する.
- デフォルト値はProgressReporting:>$ProgressReportingである.
例題
すべて開く すべて閉じる例 (4)
LaunchKernels[]実行中の全カーネルを終了し,デフォルトのローカルカーネルだけを起動する:
CloseKernels[];LaunchKernels["Local"];$KernelCount実行中の全カーネルを終了し,12個のローカルカーネルを起動する:
CloseKernels[]; LaunchKernels[12];$KernelCountLaunchKernelsは,デフォルトで,進捗情報を表示する:
LaunchKernels[{"ssh://andromeda/?64", 24, "ssh://vega/?4"}];
| |
スコープ (13)
カーネル指定 (4)
$DefaultParallelKernelsに記載されているデフォルトカーネルを起動する:
$DefaultParallelKernelsLaunchKernels[]すでに実行されているものに加え,さらに2個のローカルカーネルを起動する:
$KernelCountLaunchKernels[2]Kernels[]LaunchKernels["ssh://prokyon?2"]KernelConfigurationを使って希望するカーネルの追加的な詳細を指定する:
LaunchKernels[KernelConfiguration["localhost", "KernelCommand" -> "wolfram141", "KernelCount" -> 4]]ParallelEvaluate[{First[$CommandLine], $Version}]ローカルカーネル (3)
LaunchKernels["file:///usr/local/bin/wolfram141?4"]KernelConfigurationで特性を指定することもできる:
LaunchKernels[KernelConfiguration["localhost", "KernelCommand" -> "/usr/local/bin/wolfram141", "KernelCount" -> 2]]ローカルカーネルについては,並列カーネルのデフォルト数は,ライセンスが許す限り$ProcessorCountに等しい:
KernelConfiguration["Local"]["KernelCount"]$ProcessorCountSSHカーネル (3)
リモートカーネルへのパスとカーネル数をURLパラメータとして取得する:
LaunchKernels["ssh://prokyon//usr/local/bin/wolfram140?4"]パスとカーネル数をKernelConfigurationの特性として指定することもできる:
LaunchKernels[KernelConfiguration["ssh://prokyon", "KernelCommand" -> "/usr/local/bin/wolfram140", "KernelCount" -> 4]]適切なカーネルコマンドを自動的に選択するためにリモートのオペレーティングシステムを指定する:
LaunchKernels[KernelConfiguration["ssh://mac.example.com", "OperatingSystem" -> "MacOSX", "KernelCount" -> 4]]ParallelEvaluate[First[$CommandLine], First[Kernels[]]]URLの短縮形を使う場合は,"?n"で並列カーネルの数が指定できる:
LaunchKernels["ssh://andromeda?64"];$KernelCountWSTPServerカーネル (1)
LWGカーネル (1)
一般化と拡張 (1)
オプション (2)
ProgressReporting (2)
LaunchKernels[24, ProgressReporting -> False];$ProgressReportingのデフォルト値がFalseであっても進捗レポートを表示する:
LaunchKernels["ssh://andromeda/?64", ProgressReporting -> True];
| |
アプリケーション (1)
特性と関係 (1)
配布された定義と共有変数は実行中のカーネルおよび新たなカーネルに適用される:
n = 17; DistributeDefinitions[n];
xs = 0;SetSharedVariable[xs];ParallelEvaluate[{n, xs++}]ParallelNeedsで読み込まれたパッケージもまた実行中のカーネルおよび新たなカーネルに適用される:
ParallelNeeds["ComputerArithmetic`"]実行中のすべてのカーネルを終了し,新たなカーネルを起動する:
CloseKernels[];LaunchKernels[]新たなカーネルは前に配布された定義と共有変数を継承している:
ParallelEvaluate[{n, xs++}]ParallelEvaluate[$ContextPath, First[Kernels[]]]考えられる問題 (3)
実行中のカーネルがある場合,LaunchKernels[]はデフォルトカーネルを起動しない:
$KernelCountLaunchKernels[]実行中のすべてのカーネルを終了した後,デフォルトのカーネルを起動する:
CloseKernels[];LaunchKernels[]カーネルは最初に必要となったときに自動的に起動されることがある:
$KernelCountParallelTable[Prime[i], {i, 10}]$KernelCountCloseKernels[];ParallelTable[Prime[i], {i, 10}]使用できるカーネルがない場合,ほとんどの並列計算は連続的に行われる:
CloseKernels[];ParallelTable[Prime[i], {i, 5}]おもしろい例題 (1)
threadripper = KernelConfiguration["ssh://andromeda"]RemoteEvaluate[threadripper, $ProcessorCount]threadripper = KernelConfiguration[threadripper, "KernelCount" -> %]Information[threadripper]LaunchKernels[threadripper];$KernelCountテクニカルノート
関連するガイド
-
▪
- 並列計算の設定 ▪
- 並列計算 ▪
- リモートカーネルと並列カーネルの管理 ▪
- Wolframシステムの設定 ▪
- リモート計算
テキスト
Wolfram Research (2008), LaunchKernels, Wolfram言語関数, 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: 11-November-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: 11-November-2026]}