I extended an existing system based on XML RPC to do something similar (see the Frontier::Daemon and Frontier::Client modules for more info on setting up an XML RPC system). Using that approach, you could do something like this:
There are probably much more efficient ways to approach this, but the XML RPC system worked well in our case because it fit into our current system (we already had one set up) and it was extremely easy to implement during refactoring. Specifically, data structures can be passed as parameters without having to process and pass them on the command line or writing them to a data file. Those parameters could include data, input/output filenames, the number of machines to run on, the priority of the job, etc.
If you need more complex communication (IPC, for example), XML RPC is probably not the best choice.
The gory details:
We set up our system this way:
This description is actually a simplification of our system - in reality we have two other RPC servers listening for requests from the jobs that are being executed.
Keep in mind that when a message is sent to an XML RPC server, the server waits until that message (or more accurately, the sub called by it) is finished processing before it accepts another message. In other words, the server queues up RPC requests while it processes. If you want a nonblocking server (as we did), you need to set up your own queue system so the server can send a return message to the caller immediately. This allows some jobs to be queued and executed sequentially, while at the same time allowing other jobs to be executed immediately.
I'm sure more experienced and savvy monks will know of more efficient ways to approach this problem. I look forward to reading their responses.
In reply to Re: Distributed Computing Anyone?
by bobf
in thread Distributed Computing Anyone?
by mykbaker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |