[erlang-questions] Distributing things

Calum caluml@REDACTED
Sat Nov 7 22:02:39 CET 2009


On Sat, Nov 7, 2009 at 8:55 PM, Fabio Mazanatti
<fabio.mazanatti@REDACTED> wrote:
> Hi,
>
> the scenario I imagined for this exercise, based on Calum's text would be
> something like assigning a range of numbers to each node, starting with the
> lowest possible given by the entry parameter (the # of digits), controlling
> its distribution and wrapping things up when a prime number is found by one
> of the nodes.
>
> An example: 4 nodes, generating a prime with 6 digits, would start at
> 100.000. The entry point would assign a range from 100.000 to 105.000 to
> node 1, 105.001 to 110.000 to node 2, and so on. When a node finishes
> traversing a range, a new block is assigned to it, until one of them returns
> a valid value, and processing stops.

Hello Fabio,

Yes, this is the sort of thing I would do for this problem.
However, for other problems, perhaps the splitting method isn't so clearcut.
Also, your method only really allows for 20 nodes - what would you do
if you suddenly had 50 nodes available to join in?

Actually, in the real world, do Erlang node clusters vary in size a
lot during operation, or do most people know how many nodes they have
available at the start, and just program for that?
Is my attempting to cope with varied node numbers something that just
isn't really needed?


More information about the erlang-questions mailing list