WaitAll

WaitAll[expr]

waits for all concurrent evaluations represented by EvaluationObject expressions in expr to finish, then returns the resulting expression obtained.

Details and Options

Examples

open allclose all

Basic Examples  (4)

Wait for a single evaluation:

Waiting evaluations are scheduled concurrently on any available parallel kernel:

Longer computations display information about their progress:

Wait for all evaluations contained in a sum:

Scope  (5)

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:

Build an association with evaluation objects inside:

Evaluate all of them in parallel:

Options  (1)

ProgressReporting  (1)

Do not show a temporary progress report:

Applications  (4)

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 infinite search loop for each kernel:

Run them until manually aborted:

Properties & Relations  (4)

Evaluate an expression on any parallel kernel:

ParallelEvaluate does the same:

The "FinestGrained" 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:

Possible Issues  (3)

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:

Functions used inside parallel evaluations need to be distributed first:

Wolfram Research (2008), WaitAll, Wolfram Language function, https://reference.wolfram.com/language/ref/WaitAll.html.

Text

Wolfram Research (2008), WaitAll, Wolfram Language function, https://reference.wolfram.com/language/ref/WaitAll.html.

CMS

Wolfram Language. 2008. "WaitAll." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/WaitAll.html.

APA

Wolfram Language. (2008). WaitAll. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/WaitAll.html

BibTeX

@misc{reference.wolfram_2024_waitall, author="Wolfram Research", title="{WaitAll}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/WaitAll.html}", note=[Accessed: 22-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_waitall, organization={Wolfram Research}, title={WaitAll}, year={2008}, url={https://reference.wolfram.com/language/ref/WaitAll.html}, note=[Accessed: 22-December-2024 ]}