Run a Parallel Computation

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:

In[1]:=
Click for copyable input
Out[1]=
  • 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:

In[4]:=
Click for copyable input

Using Parallelize...

Some expressions can be automatically evaluated on parallel kernels using Parallelize:

In[5]:=
Click for copyable input
Out[5]=
Notes
If an expression is not parallelizable, it will be run sequentially.
In[6]:=
Click for copyable input
Out[6]=
Parallel computations are not currently supported on mobile devices or in the cloud and will instead be run sequentially.