ClearDistributedDefinitions[s1,s2,…]
以前配布されたシンボル siのすべての定義をすべての並列カーネルから削除する.
以前配布されたシンボルの定義をすべて消去する
ClearDistributedDefinitions
ClearDistributedDefinitions[s1,s2,…]
以前配布されたシンボル siのすべての定義をすべての並列カーネルから削除する.
以前配布されたシンボルの定義をすべて消去する
詳細
- ClearDistributedDefinitions[{s1,s2,…}]はClearDistributedDefinitions[s1,s2,…]に等しい.
- ClearDistributedDefinitionsは,DistributeDefinitionsの結果として並列サブカーネル上に配布されたすべての定義を消去する.
- マスターカーネル上の定義は消去されない.
- ClearDistributedDefinitionsは属性HoldAllを有する.
例題
すべて開く すべて閉じる例 (1)
$DistributedContexts = None;f[x_] := {x, $KernelID}DistributeDefinitions[f]ParallelEvaluate[f[$KernelID]]シンボル fは,配布された全シンボルのリストに含まれている:
$DistributedDefinitionsClearDistributedDefinitions[]この関数はサブカーネルではもはや認識されず,返された後ではじめて評価される:
ParallelEvaluate[f[$KernelID]]シンボルfは,配布された全シンボルのリストに含まれなくなった:
$DistributedDefinitionsスコープ (1)
f[x_] := {x, $KernelID}
s := $KernelID
g/:h[_g] := {g}
SetAttributes[h, HoldFirst]DistributeDefinitions[f, s, g, h]すべてのシンボルが配布されたシンボルのリストに含まれている:
$DistributedDefinitionsClearDistributedDefinitions[f]//OutputForm$DistributedDefinitionsClearDistributedDefinitions[g, h]ClearDistributedDefinitions[]$DistributedDefinitions考えられる問題 (3)
デフォルトで,現行コンテキストのシンボルは自動的に配布される:
mat = RandomInteger[{0, 9}, {2, 2}]ParallelEvaluate[Inverse[mat]]$DistributedDefinitionsClearDistributedDefinitions[mat]$DistributedDefinitionsmatが並列計算で使われるや否や,その定義が自動的に再配布される:
ParallelEvaluate[Inverse[mat]]$DistributedDefinitions定義の配布を手動で制御したければ,定義の自動配布を無効にするとよい:
$DistributedContexts = None;a = 42;ParallelEvaluate[Head[a]]$DistributedDefinitionsDistributeDefinitions[a]ParallelEvaluate[Head[a]]$DistributedDefinitions関連するガイド
-
▪
- 並列計算の設定 ▪
- データの並列性 ▪
- 並列計算におけるリソースの共有
テキスト
Wolfram Research (2024), ClearDistributedDefinitions, Wolfram言語関数, https://reference.wolfram.com/language/ref/ClearDistributedDefinitions.html.
CMS
Wolfram Language. 2024. "ClearDistributedDefinitions." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ClearDistributedDefinitions.html.
APA
Wolfram Language. (2024). ClearDistributedDefinitions. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ClearDistributedDefinitions.html
BibTeX
@misc{reference.wolfram_2026_cleardistributeddefinitions, author="Wolfram Research", title="{ClearDistributedDefinitions}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/ClearDistributedDefinitions.html}", note=[Accessed: 13-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_cleardistributeddefinitions, organization={Wolfram Research}, title={ClearDistributedDefinitions}, year={2024}, url={https://reference.wolfram.com/language/ref/ClearDistributedDefinitions.html}, note=[Accessed: 13-August-2026]}