Mathematica > Systems Interfaces & Deployment > Parallel Computing > Data Parallelism > ParallelDo >
Mathematica > Core Language > Tuning & Debugging > Parallel Computing > Data Parallelism > ParallelDo >

ParallelDo

ParallelDo
evaluates expr in parallel times.
ParallelDo
evaluates expr in parallel with the variable i successively taking on the values 1 through (in steps of 1).
ParallelDo
starts with .
ParallelDo
uses steps di.
ParallelDo
uses the successive values , , ....
ParallelDo
evaluates expr looping in parallel over different values of j, etc. for each i.
  • ParallelDo is a parallel version of Do that automatically distributes different evaluations of expr among different kernels and processors.
  • If side effects involve unshared variables, they will in general work differently than in Do.
ParallelDo works like Do, but in parallel:
No results are returned by ParallelDo:
Use a shared variable to communicate results found to the master kernel:
ParallelDo works like Do, but in parallel:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
 
No results are returned by ParallelDo:
 
Use a shared variable to communicate results found to the master kernel:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
Calculations with vastly differing runtimes should be parallelized as finely as possible:
A large number of simple calculations should be distributed into as few batches as possible:
By default, definitions in the current context are distributed automatically:
Do not distribute any definitions of functions:
Distribute definitions for all symbols in all contexts appearing in a parallel computation:
Distribute only definitions in the given contexts:
Restore the value of the DistributedContexts option to its default:
Generate a number of animation frames and save them to individual files:
Import every 5^(th) file and display it:
ParallelDo performs the same iterations as ParallelTable, but does not return the values:
A function used that is not known on the parallel kernels has no effect:
Define the function on all parallel kernels:
The function is now evaluated on the parallel kernels:
Definitions of functions in the current context are distributed automatically:
Side effects are local to each parallel kernel:
Use a shared variable to support global side effects:
New in 7 | Last modified in 8
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF