Take advantage of multicore computers by running compute-intensive computations on multiple kernels.
Using ParallelTable...
Use ParallelTable to parallelize a Table computation. For example, evaluate $ProcessID on parallel kernels, returning the process ID of each kernel:
- The number of kernels available for parallel computation typically corresponds to the number of CPU cores.
- A parallel computation may run more slowly than the non-parallel version if the computation takes less time than the overhead of parallelization.
On a multicore CPU, ParallelTable may run significantly faster than Table:
Using ParallelMap...
Use ParallelMap to parallelize a Map computation. For example, identify the images on the Wikipedia page on dogs:
Using Parallelize...
Some expressions can be automatically evaluated on parallel kernels using Parallelize:
- Parallelize will replace some functions with parallel forms such as ParallelTable, ParallelMap, ParallelSum, ParallelProduct, ParallelDo and ParallelArray.
- Parallelize automatically parallelizes Listable functions with one argument, such as Prime and Sqrt.