ClearDistributedDefinitions
ClearDistributedDefinitions[s1,s2,…]
clears all previously distributed definitions of symbols si on all parallel kernels.
clears all previously distributed definitions of all symbols.
Details
![](Files/ClearDistributedDefinitions.en/details_1.png)
- ClearDistributedDefinitions[{s1,s2,…}] is equivalent to ClearDistributedDefinitions[s1,s2,…].
- ClearDistributedDefinitions clears all definitions made on parallel subkernels as a result of DistributeDefinitions or automatic distribution of definitions.
- Definitions on the master kernel are not cleared.
- ClearDistributedDefinitions has attribute HoldAll.
Examples
open allclose allBasic Examples (1)
Disable the automatic distribution of definitions:
Distribute the definition of a function:
Use the function on the parallel subkernels:
The symbol f appears in the list of all distributed symbols:
Clear the distributed definitions:
The function is no longer known on the subkernels; it is evaluated only after being returned:
The symbol f no longer appears in the list of all distributed symbols:
Scope (1)
Make various types of definitions for a set of symbols:
Distribute the definitions to all parallel subkernels:
All symbols appear in the list of distributed symbols:
Clear the distributed definitions of the symbol f:
f no longer appears in the list of distributed symbols:
Clear the distributed definitions of several symbols:
Possible Issues (3)
By default, symbols in the current context are automatically distributed:
Clearing the distributed definitions may seem to work:
As soon as mat is used again in a parallel computation, its definition will be distributed automatically again:
Disable automatic distribution of definitions if you wish to control distribution of definitions manually:
The definition of a has not been distributed to parallel subkernels:
Text
Wolfram Research (2024), ClearDistributedDefinitions, Wolfram Language function, 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