Expressions that cannot be parallelized are evaluated normally:
Side effects cannot be used in the function mapped in parallel:
Use a shared variable to support side effects:
If no subkernels are available, the result is computed on the master kernel:
If a function used is not distributed first, the result may still appear to be correct:
Only if the function is distributed is the result actually calculated on the available kernels:
Definitions of functions in the current context are distributed automatically:
Definitions from contexts other than the default context are not distributed automatically:
Use
DistributeDefinitions to distribute such definitions:
Alternatively, set the
DistributedContexts option to include all contexts:
Explicitly distribute the definition of a function:
Modify the definition:
The modified definition is automatically distributed:
Suppress the automatic distribution of definitions:
Symbols defined only on the subkernels are not distributed automatically:
Set the value of the
DistributedContexts option of
Parallelize:
Restore all settings to their default values:
Trivial operations may take longer when parallelized: