PVM INSTALLATION AND USE IN ROCKS 2.3.2 CLUSTERS HOWTO ====================================================== (By Jose Luis Guisado, University of Extremadura, Spain, Aug-2005) E-mail: jlguisado at unex.es 1. HOW TO SETUP PVM: -------------------- - PVM lib and bin directories need to be copied on every node which should run PVM, so that the pvm daemon can be started on every node. If you install PVM under your home directory in the master node, it will be automatically mounted by the automounter on each compute node when needed, so you don't have to worry about copying PVM on every compute node. Alternatively (this is the alternative explained here), you can use the default PVM installation that comes with the Rocks distribution, which has PVM in a central location in the master node to be shared by all users, and copy the PVM lib and bin directories (or the whole PVM directory) in the home directory of each user who should run PVM, in order to be automatically mounted on the compute nodes to run the pvm daemon there when needed. Therefore, you must: - Copy the directory /usr/share/pvm3 in your home directory: $ cp -r /usr/share/pvm3 $HOME/ - Append the following to $HOME/.bashrc (this is taken from the file bashrc.stub in the /lib directory of PVM, and slightly modified): export PVM_RSH=/usr/bin/ssh if [ -z $PVM_ROOT ]; then if [ -d ~/pvm3 ]; then export PVM_ROOT=~/pvm3 else export PVM_ROOT=/usr/share/pvm3 fi fi if [ -n $PVM_ROOT ]; then export PVM_ARCH=`$PVM_ROOT/lib/pvmgetarch` export PATH=$PATH:$PVM_ROOT/lib # lib generic export PATH=$PATH:$PVM_ROOT/lib/$PVM_ARCH # lib arch-specific export PATH=$PATH:$PVM_ROOT/bin/$PVM_ARCH # bin arch-specific fi (The $HOME directory is shared across all the cluster nodes so you only need to do this once). - Execute ~/.bash_profile (which executes ~/.bashrc): $source .bash_profile - FIX A PROBLEM IN THE DEFAULT PVM INSTALLATION: It looks the PVM version included in Rocks 2.3.2 has a problem inherited from RedHat: The stock pvm-3.4.3-4 which comes with Redhat 6.2 powertools has a broken pvm script installed in /usr/bin which doesn't pass the arguments to /usr/share/pvm3/lib/pvm. To fix it, the last line of /usr/bin/pvm should read "/usr/share/pvm3/lib/pvm $@". 2. HOW TO COMPILE PROGRAMS USING PVM: ------------------------------------- - Compile programs (for instance, the supplied examples): $ cd $HOME/pvm3/examples $ aimk hello hello_other 3. HOW TO RUN COMPILED PROGRAMS USING PVM: ------------------------------------------ - Login as your user - Run an ssh-agent that automatically supplies the SSH key to the compute nodes instead of asking for it to the user: $ ssh-agent $SHELL $ ssh-add - Run pvm: $ pvm - Add hosts to the virtual machine: pvm> add hostname ... - In another window, run your program: $ ./hello - To use a "hostfile" configuration file with the initial configuration of hosts, add the file (composed as explained in the PVM documentation) to your working directory and execute pvm with the name of the file as a parameter. For example: $ pvm hostfile_myconfig1 4. HOW TO SHUT DOWN A VIRTUAL PVM MACHINE: ------------------------------------------ a) The preferred way: "halt" command at the PVM console. b) In case of problems: kill the pvmd processes: kill -s SIGTERM pid. Normally, killing the master pvmd kills every local tasks and every slave pvmd processes. In case these are not killed, they can be directly killed using the same signal.