 |
ParallelSum
The commands in this section are fundamental to parallel programming in Mathematica. ParallelEvaluate[h[e1,e2,...]] | evaluates the elements ei in parallel and returns h[ r1, r2, ...], where ri is the result of evaluating ei |
| ParallelMap[ f, h[ e1, e2, ...]] | evaluates h[ f[e1], f[e2] ,...] in parallel. |
| ParallelTable[expr,{i,i0,i1,di},{j,j0,j1,dj},...] |
| | builds Table[expr,{i,i0,i1,di},{j,j0,j1,dj},...] in parallel; parallelization occurs along the first (outermost) iterator {i, i0, i1,di } |
| ParallelSum[...], ParallelProduct[...] |
| | computes sums and products in parallel |
Parallel evaluation, mapping, and tables.
ParallelEvaluate has attribute HoldFirst, so that its argument is not evaluated on the local kernel. After receiving the results, r i, the expression h[ r1, r2,...] is further evaluated normally on the local kernel. The symbol List is often used as the head h. is a parallel version of evaluating the individual f[ei]in parallel rather than sequentially. ParallelEvaluate and related commands use all available remote kernels on the list $Slaves. |