Ambles

Overview of ambles

This describes the general idea behind preambles and postambles in xdistribute.

There are two different types of ambles: a preamble and a postamble. A preamble is a process that is run on a machine before the machine starts running normal user processes. The preamble process is only run once per machine. A postamble process is a process that is run after all of the processes in the system have finished. The postamble process is also run only once per machine.

Preamble and postamble process are nice ways to do machine specific setup on a remote machine before you start running a bunch of processes. The preamble can be used to copy any software to the remote machine and then, perhaps, to compile it. The postamble process can then be used to remove the software when you are done.

The preambles and postambles are specified in the normal process files by adding an extra word before the process:

    preamble: mkdir /tmp/t1 ; cd /tmp/t1 ; \\
         rcp pettyk@paleale:sim.tar . ; tar -x sim.tar ; \\
         make sim
    stdout: preamble
In this example the preamble process to be run on each machine will first make a temporary directory, copy the file sim.tar over, un-tar it and then compile the code. This would set up the machine for the user processes. The postamble would be specified like this:
    postamble: cd /tmp ; rm -rf t1
    stdout: postamble
This postamble would simply remove the code once you are done. The stdout specification simply tells the server to put the output from the amble in a file that has the prefix "preamble" (or "postamble") with the postfix being the remote machine name.