generates in parallel a list of imax copies of expr.
generates in parallel a list of the values of expr when i runs from 1 to imax.
starts with i=imin.
uses steps di.
uses the successive values i1, i2, ….
gives a nested list. The list associated with i is outermost.
Details and Options
- ParallelTable is a parallel version of Table which automatically distributes different evaluations of expr among different kernels and processors.
- ParallelTable will give the same results as Table, except for side effects during the computation.
- Parallelize[Table[expr,iter, …]] is equivalent to ParallelTable[expr,iter,…].
- If an instance of ParallelTable cannot be parallelized it is evaluated using Table.
- The following options can be given:
Method Automatic granularity of parallelization DistributedContexts $DistributedContexts contexts used to distribute symbols to parallel computations ProgressReporting $ProgressReporting whether to report the progress of the computation
- The Method option specifies the parallelization method to use. Possible settings include:
"CoarsestGrained" break the computation into as many pieces as there are available kernels "FinestGrained" break the computation into the smallest possible subunits "EvaluationsPerKernel"->e break the computation into at most e pieces per kernel "ItemsPerEvaluation"->m break the computation into evaluations of at most m subunits each Automatic compromise between overhead and load balancing
- Method->"CoarsestGrained" is suitable for computations involving many subunits, all of which take the same amount of time. It minimizes overhead, but does not provide any load balancing.
- Method->"FinestGrained" is suitable for computations involving few subunits whose evaluations take different amounts of time. It leads to higher overhead, but maximizes load balancing.
- The DistributedContexts option specifies which symbols appearing in expr have their definitions automatically distributed to all available kernels before the computation.
- The default value is DistributedContexts:>$DistributedContexts with $DistributedContexts:=$Context, which distributes definitions of all symbols in the current context, but does not distribute definitions of symbols from packages.
- The ProgressReporting option specifies whether to report the progress of the parallel computation.
- The default value is ProgressReporting:>$ProgressReporting.
Examplesopen allclose all
Basic Examples (6)
Restore the value of the DistributedContexts option to its default:
Use Method"FinestGrained" for the most accurate progress report:
Properties & Relations (10)
Using multiple iteration specifications is equivalent to nesting Table functions:
ParallelArray iterates over successive integers:
Map applies a function to successive elements in a list:
Table can substitute successive elements in a list into an expression:
Possible Issues (3)
Use DistributeDefinitions to distribute such definitions:
Alternatively, set the DistributedContexts option to include all contexts:
Wolfram Research (2008), ParallelTable, Wolfram Language function, https://reference.wolfram.com/language/ref/ParallelTable.html (updated 2010).
Wolfram Language. 2008. "ParallelTable." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2010. https://reference.wolfram.com/language/ref/ParallelTable.html.
Wolfram Language. (2008). ParallelTable. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ParallelTable.html