X-Y-GMX-Trusted: 0Thursday, April 10, 2008, 1:38:54 AM, Christian wrote:> On 07.04.2008, at 18:17, Christian Langreiter wrote:>> much more interesting, however, would be to test the peaching variant,> after experimenting with the peaching variant a bit [...] and> splitting into 100 "work packages", we get:To expand a bit on that: in the original peach variation Chris posted,Kdb+ generated the whole 1m integer vector in the master, thenreshaped it into work packages and passed those to the slaves.A quick look at the code of the Erlang variant [1] and we gatheredthat the Erlang version does similar blocking, but of course withoutall the data: workers are spawned with an offset parameter and returntheir part of the sum.So we tried reducing the "til 1000000" a bit, instead passing offsetsto workers and let the workers generate their own, smaller worksets,e.g. til 10000. This works fine and scales far better. The finalvariation posted by Chris speeds up things a little more, by simplycalculating the til 10000 once and passing that to each worker alongwith the offset:> s:%n:1000000;> -s-s*+/{[x;o]+/4%1+t*t:s*o+x}[!10000]':10000*!100[1] http://groups.google.com/group/erlang-questions/browse_thread/thread/7abaaddeb95a8081)-- Andreas Bolka