Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Systems Interfaces & Deployment > Parallel Computing > Parallelization >
Mathematica > Core Language > Tuning & Debugging > Parallel Computing > Parallelization >

Parallelization

Parallelization
is an option for Compile that specifies whether it should create a compiled function that could run in parallel.
  • Compiled functions only run in parallel if Listable is one of the RuntimeAttributes and the function threads over list arguments.
  • Compiled functions run in parallel using multiple threads of execution.
  • If a compiled function running in parallel has several threads trying to call ordinary Mathematica code, only one thread can do this at any time.
  • The following settings can be used:
Truecreate parallel code
Falsecreate single-thread code
Automaticuse parallelization for optimal arguments
Listable compiled functions can execute in parallel:
This shows the operation running sequentially:
Typically, $ProcessorCount is used to determine how many threads can be used:
Listable compiled functions can execute in parallel:
In[1]:=
Click for copyable input
Out[1]=
This shows the operation running sequentially:
In[2]:=
Click for copyable input
Out[2]=
Typically, $ProcessorCount is used to determine how many threads can be used:
In[3]:=
Click for copyable input
Out[3]=
New in 8
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF