 |
Dispatching Evaluations to Remote Kernels| ParallelDispatch[h[e1,e2,...,en],{k1,k2,...,km}] |
| | evaluateseion kernel ki and returns h[ r1, r2, ... rn],whereriis the result of evaluatingei. The default list of kernels is $Slaves |
| ParallelEvaluate[h[e1,e2,...,en],f,comb] |
| | evaluates f[h[e1,e2,...,en]] in parallel by distributing chunks f[h[ei,ei+1,...,ei+k]] to all kernels and combining the results with comb[]. |
| ParallelEvaluate[h[e1,e2,...,en],f] |
| | the default combiner comb is h, if h has attribute Flat, and Join otherwise |
| ParallelEvaluate[h[e1,e2,...,en]] |
Basic parallel dispatch of evaluations. In ParallelDispatch[h [e 1,e 2,...,e n],{k 1,k 2,...,k m}], the number m of kernels must be at least as large as the number n of expressions. ParallelDispatch has the attribute HoldFirst so that h [e 1,e 2,...,e n] is not evaluated on the master kernel before the parallelization. ParallelDispatch[{e 1,e 2,...,e n},{k 1,k 2,...,k n}] is equivalent to Receive[Inner[Send,{k 1,k 2,...,k n},{e 1,e 2,...,e n}]]. ParallelEvaluate[h [e 1,e 2,...,e n],f,comb] breaks h [e 1,e 2,...,e n] into as many pieces h [e i,e i+1,...,e i+k] as there are remote kernels, evaluates f[h [e i,e i+1,...,e i+k]] in parallel (using ParallelDispatch[]), then combines the results r i using comb[r 1,r 2,...,r m]. ParallelEvaluate has the attribute HoldFirst so that h [e 1,e 2,...,e n] is not evaluated on the master kernel before the parallelization. The size of the pieces of the input expression is chosen to be proportional to the remote processor speed estimates for optimal load balancing. |