Re: Parallel Toolkit Example

*To*: mathgroup at smc.vnet.net*Subject*: [mg50446] Re: [mg50425] Parallel Toolkit Example*From*: Geoff Hulette <ghulette at collidescope.net>*Date*: Sat, 4 Sep 2004 01:43:22 -0400 (EDT)*References*: <200409030735.DAA15550@smc.vnet.net> <41387904.6000904@wolfram.com>*Sender*: owner-wri-mathgroup at wolfram.com

On Sep 3, 2004, at 10:00 AM, Daniel Lichtblau wrote: > Geoff Hulette wrote: >> Hi, >> I am looking for an efficient example of using the Parallel Toolkit. >> Many other people on this forum seem to have noted what I have also >> found to be the case, that the ParallelMap and ParallelTable commands >> aren't terribly efficient. The example code in ParEval.nb, for >> instance >> ParallelMap[FactorInteger, (10^Range[20, 40] )/9] >> only seems to run about 20% faster on a six-node cluster vs my >> laptop. Does anyone have an example of how to solve this same >> problem using an efficient parallel technique? I am fairly new to >> Mathematica, so please be explicit. >> Thanks, >> -geoff >> Geoff Hulette >> MIT Academic Computing >> ghulette at mit.edu > > Not that I know anything about it, but you are probably looking at a > latency issue with this example. Generally speaking for ParallelMap et > al to be of use the time to process the individual elements needs to > be large compared to the overhead time of shipping back and forth over > processors. From what I can tell this is not the case for your example > (they all factor quite quickly). > > If they did not you could run into a different problem. For some sets > of integers the overall factorization speed will be dominated by the > time needed to factor one particular element. In such cases again a > parallelized version would not be of much help. But for sets where two > or more of the inputs are slow to factor it would of course give a > considerable boost. > > > Daniel Lichtblau > Wolfram Research > > Well, that is certainly true. But, if I am not mistaken (and I could be, since I am new to Mathmatica), the problem I am trying out factors a large range of integers, and the computation for any one element in the set to be factored can be computed independently of the others. So, I suspect that the ParallelMap command is inefficient in that it first computes the range (20 integers, in this case), and sends each one (20 problems total) out over the network. A far more efficient solution would be break the problem up over the number of processors available, and let each node handle its part of the range. In this case each processor would only have to handle one (somewhat more difficult) problem, reducing the latency. This would also allow the process to scale better, as the range increases, since each processor would always only be tackling one problem (with only one associated overhead cost), while the time spent in computation would increase according to the complexity of the problem. Does anybody have a way to do this? Or, as a matter of fact, does anyone have any examples at all of efficient Parallel Toolkit routines? Thanks, geoff

**References**:**Parallel Toolkit Example***From:*Geoff Hulette <ghulette@collidescope.net>