DistributeDefinitions
This feature is not supported on the Wolfram Cloud.

DistributeDefinitions[s1,s2,]
distributes all definitions for the symbols si to all parallel kernels.

DistributeDefinitions["context`"]
distributes definitions for all symbols in the specified context.

Details and OptionsDetails and Options

  • DistributeDefinitions in effect applies ParallelEvaluate to all assignments for values and attributes with the symbols si, including not only ownvalues but also downvalues, upvalues, and other types of values.
  • DistributeDefinitions applies itself recursively to any symbols appearing in the definitions of the symbols si.
  • DistributeDefinitions has attribute HoldAll.
  • DistributeDefinitions in effect "registers" the definitions for the symbols si so that they are automatically distributed to every new parallel kernel that may be launched.
  • DistributeDefinitions[expr] for an arbitrary expression expr distributes definitions for all symbols appearing in expr.

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

Make sure parallel subkernels are launched:

In[1]:=
Click for copyable input
Out[1]=

Values used in subkernels need to be distributed first:

In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
Out[3]=
In[4]:=
Click for copyable input
Out[4]=
In[5]:=
Click for copyable input
Out[5]=

Symbols in the default context are distributed automatically:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
Introduced in 2008
(7.0)
| Updated in 2010
(8.0)
Translate this page: