net-eval - Simple distributed computing.

Table of Contents

net-eval allows you to evaluate expressions in parallel on remote network nodes. net-eval handles all the work necessary to communicate to other nodes, distribute expressions for evaluation and collect results.


Project is hosted at github, grab it here.


On the machine which you want to distribute work from, add the src/ folder to your classpath, on the remote nodes, you need to have a REPL server running, if you build the project with lein resulting Jar will fire up a REPL server.


In order to evaluate expressions remotely you need to define a task,

(deftask atask []
  (+ 1 2))

You can call and test tasks just like functions, when you are ready to distribute the work call net-eval,

(net-eval [["" 9999 #'atask]
           ["" 9999 #'atask]
           ["" 9999 #'atask]
           ["" 9999 #'atask]])

net-eval takes a sequence of vectors, containing host port and task to send and returns a sequence future objects, each corresponding to a result from a remote node. For tasks that takes arguments you can append any number of arguments after the task,

(deftask atask [a]
  (range a))

(net-eval [["" 9999 #'atask 5]
           ["" 9999 #'atask 5]
           ["" 9999 #'atask 5]
           ["" 9999 #'atask 5]])


Beerware Revision 42