This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

WaitAll

WaitAll[expr]
waits for all concurrent evaluations represented by EvaluationObject expressions in expr to finish, then returns the resulting expression obtained.
Wait for a single evaluation:
Waiting evaluations are scheduled concurrently on any available parallel kernel:
Wait for all evaluations contained in a sum:
Functions used need to be distributed first:
Wait for a single evaluation:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
 
Waiting evaluations are scheduled concurrently on any available parallel kernel:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
 
Wait for all evaluations contained in a sum:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
 
Functions used need to be distributed first:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=
Wait for a single evaluation:
Wait for a number of evaluations in a list:
Wait for evaluations contained in an arbitrarily nested structure:
Wait for evaluations contained in an arbitrary arithmetic expression:
Run a search for a random prime on each parallel kernel:
Watch the scheduling of the evaluations while they are running:
Write a command that evaluates the arguments of a list in parallel:
Watch the scheduling of evaluations taking vastly varying amounts of time:
Find such that is prime, scheduling one search loop for each kernel:
Run them until manually aborted:
Evaluate an expression on any parallel kernel:
ParallelEvaluate does the same:
The Method setting schedules each item as a single evaluation:
Internally it works similarly to WaitAll[ParallelSubmit[...]]:
Parallelize at the innermost level of a multidimensional table:
Scheduled evaluations no longer needed can be aborted with AbortKernels:
Define a number of tasks with varying runtimes:
Measure the time for parallel execution:
Scheduling larger tasks first improves load balancing:
Each evaluation should be waited for exactly once:
The evaluation object has already been completed:
There is a considerable overhead for scheduling trivial calculations:
The overhead is smaller for generating fewer, but larger, evaluation units:
A sequential evaluation avoids all communication overhead:
New in 7