For Programmers: Free Programming Magazines  


Home > Archive > Functional > April 2007 > erlang for grid computing









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author erlang for grid computing
jsnX

2007-04-19, 8:04 am

Is anyone on the list using Erlang for grid computing? Does anybody
have any choice samples to share? I'm evaluating Erlang for a new grid
computing application and I'd love to hear about what other people are
doing with it. Even a sample of heat diffusion would be helpful.

Garry Hodgson

2007-04-19, 7:04 pm

jsnX <jason.dusek@gmail.com> wrote:

> Is anyone on the list using Erlang for grid computing? Does anybody
> have any choice samples to share? I'm evaluating Erlang for a new grid
> computing application and I'd love to hear about what other people are
> doing with it. Even a sample of heat diffusion would be helpful.


i have, and it's great. i don't have code to share, nor would you want to see
the mess i made of it at the time. once piece of advice, if you're looking to
build a real system instead of just playing around: make sure you build it
on top of the OTP framework, not just erlang. erlang is a language.
erlang/otp is a system for building production quality services. there're
a few tutorials at trapexit.org and elsewhere, and joe armstrong's got a
new book coming out at pragmatic programmers.

you'll probably get better response posting to erlang-questions@erlang.org.


----
Garry Hodgson, Senior Software G, AT&T CSO

nobody can do everything, but everybody can do something.
do something.

Garry Hodgson

2007-04-19, 7:04 pm

jsnX <jason.dusek@gmail.com> wrote:

> Is anyone on the list using Erlang for grid computing?


no sooner had i replied to you than i saw this on erlanq-questions:

Christoph Dornheim <cd5@gmx.de> wrote:

> I have just added a tutorial "A framework for clustering
> generic server instances" to trapexit.org that can be found at
>
> http://wiki.trapexit.org/index.php/Category:HowTo


----
Garry Hodgson, Senior Software G, AT&T CSO

nobody can do everything, but everybody can do something.
do something.

Ulf Wiger

2007-04-20, 4:04 am

>>>>> "GH" == Garry Hodgson <garry@sage.att.com> writes:

GH> jsnX <jason.dusek@gmail.com> wrote:[color=darkred]

GH> no sooner had i replied to you than i saw this on
GH> erlanq-questions:

GH> Christoph Dornheim <cd5@gmx.de> wrote:
[color=darkred]


I haven't commented on the howto (I've only browsed it quickly),
but in this particular forum, I'd like to comment that another
interesting framework is gen_leader. Gen_leader is a generic
leader election behaviour. Thomas Arts and Hans Svensson did
some really good work on it, identifying a suitable leader
election algorithm for erlang, and verifying the solution
using model checking, abstract traces and QuickCheck.

http://www.cs.chalmers.se/~hanssv/leader_election/

It's quite easy to use. An example program illustrates
a replicated dictionary, where each update to the
dictionary is replicated as a function object, and
performed on each copy of the dictionary (other
strategies are of course possible.)

new(Name, Candidates, Workers) ->
gen_leader:start(Name,Candidates, Workers,
test_cb, dict:new(), []).

-define(store(Dict,Expr,Legend),
gen_leader:leader_call(Dict, {store, fun(D) ->
Expr
end})).

-define(lookup(Dict, Expr, Legend),
gen_leader:call(Dict, {lookup, fun(D) ->
Expr
end})).

%% dict functions that modify state:
append(Key, Value, Dict) ->
?store(Dict, dict:append(Key,Value,D), append).
append_list(Key, ValList, Dict) ->
?store(Dict, dict:append_list(Key,ValList,D), append_list).
....
fetch(Key, Dict) -> ?lookup(Dict, dict:fetch(Key,D), fetch).
fetch_keys(Dict) -> ?lookup(Dict, dict:fetch_keys(D), fetch_keys).
....


The following code in the callback module makes it all
work:

%%% call directed to the leader instance:
handle_leader_call({store,F}, _From, Dict, _E) ->
NewDict = F(Dict),
{reply, ok, {store, F}, NewDict};
handle_leader_call({leader_lookup,F}, _From, Dict, _E) ->
Reply = F(Dict),
{reply, Reply, Dict}.

%%% event propagated from the leader:
from_leader({store,F}, Dict, _E) ->
NewDict = F(Dict),
{ok, NewDict}.

%% local call
handle_call({lookup, F}, _From, Dict) ->
Reply = F(Dict),
{reply, Reply, Dict}.


BR,
Ulf W
--
Ulf Wiger, Senior Specialist,
/ / / Architecture & Design of Carrier-Class Software
/ / / Team Leader, Software Characteristics
/ / / Ericsson AB, IMS Gateways
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com