evaluates the expression expr on all available parallel kernels and returns the list of results obtained.
evaluates expr on the parallel kernel specified.
evaluates expr on the parallel kernels keri.
wraps the head h around the results before returning them.
Details and Options
- ParallelEvaluate has attribute HoldFirst.
- Kernels can be specified either using KernelObject, as returned by Kernels, or using their integer IDs, as returned by $KernelID. All can also be used.
- The DistributedContexts option for ParallelEvaluate specifies which symbols appearing in expr have their definitions automatically distributed to all available kernels before the computation.
- The default value is DistributedContexts:>$DistributedContexts with $DistributedContexts:=$Context, which distributes definitions of all symbols in the current context, but does not distribute definitions of symbols from packages.
Examplesopen allclose all
Basic Examples (1)
Use ParallelEvaluate to perform initializations on all parallel kernels:
Generalizations & Extensions (2)
Restore the value of the DistributedContexts option to its default:
Properties & Relations (5)
ParallelEvaluate performs the same evaluation on each subkernel:
Parallelize distributes parts of an evaluation to each subkernel:
Force the same result by setting SeedRandom:
An explicit ParallelEvaluate does the same:
The effects of ParallelEvaluate are not remembered:
ParallelEvaluate automatically distributes definitions of functions used:
Possible Issues (2)
Suppress the automatic distribution of definitions when making definitions with ParallelEvaluate: