Sep. 20 1996 pkc Sep. 21 1999 updated with new info ... pkc Apr. 18 2000 updated with new info ... pkc Jun. 03 2003 updated to work with lam 7.0 and epsilon's ... miles Oct. 07 2003 minor updates to the instructions ... miles LAM 7.X Configuration --------------------- LAM install consists of the following steps: - update of .cshrc - testing of ssh - creating boot file - testing LAM install - running test program Step 1 .cshrc update -------------------- In order to be able to run LAM, a set of env. variables, and path variable have to be updated to include LAM files. To do that edit file ~/.cshrc and add the following lines: if ( -e /usr/local/lam70/setup_lam ) then source /usr/local/lam70/setup_lam endif Before you continue with Step 2, LOGOFF and re-logon for the changes to take effect. Step 2. Testing ssh ------------------- In order for Lam to work, it has to execute command ssh from one host to another without having to give a password. In order not to have to supply a password each time do: 1. ssh-keygen -t rsa 2. now enter a filename, ie, identity and no passphrase 3. make sure you have ~/.ssh dir and 'chmod 700 ~/.ssh'. 4. mv identity.pub ~/.ssh/authorized_keys 5. chmod 600 ~/.ssh/authorized_keys 6. mv identity ~/.ssh/identity Since ssh requires first time users to answer yes/no when connecting to a new host, you will have to ssh to each of the hosts and answer yes ( there is a script that will help you with this ). Run command: /usr/local/lam70/ssh_init Re-run the command again - this time you should not be asked to answer yes/no - all hosts should report as being OK: /usr/local/lam70/ssh_init Now try to ssh to the another host, and see if .cshrc has been setup the right way - execute: ssh -x -q epsilon01 lamboot -h This should display syntax for a command called lamboot ( to be used later ). If ssh asks you for a password, ssh_init has not been setup the right way, or if lamboot is not found ~/.cshrc was not setup right. Step 3 Creating Lam boot file ----------------------------- Lam boot file lists all the hosts that will make up your MPI network. The only important rule is that the system your are on has to be included in the boot file, on the first line. There is no fixed name for the boot file, but most people use name hosts. As an example lets create file ~/hosts with the following ( assuming we are on epsilon08 ): epsilon08 epsilon02 epsilon03 IMPORTANT NOTE: apex can not be used as part of a Lam network !!! Step 4 Testing Lam ------------------ We are now ready to boot up the Lam system, using previously created boot file 'hosts'. The command used to boot Lam is lamboot ( see the man page using command lman i.e. lman lamboot ): epsilon08:~> lamboot -v hosts LAM 7.0/MPI 2 C++/ROMIO - Indiana University n0<17574> ssi:boot:base:linear: booting n0 (epsilon08) n0<17574> ssi:boot:base:linear: booting n1 (epsilon02) n0<17574> ssi:boot:base:linear: booting n2 (epsilon03) n0<17574> ssi:boot:base:linear: finished Step 5 Running test program ---------------------------- A very simple MPI example program hello_mpi.c is located in $LAMHOME - copy it to your home directory with: cp /usr/local/lam70/hello_mpi.c ~ Compile it to create Lam executable image: hcc hello_mpi.c -o hello_mpi -lmpi Now we can execute the program - the important factor to remember is that when Lam runs on a remote host ( i.e. after it does an ssh ), the search path will only include the standard locations, as a result the best way to run a program under Lam is to specify its absolute location. Here is a sample run and output: epsilon08:~> mpirun -c 3 $cwd/hello_mpi epsilon08:~> Cluster size 3 Hello from process 1! Hello from process 2! Before we are done with Lam, we need to kill off any old processes with: wipe -v hosts IMPORTANT: always remember to clean up your old processes. Use command ps -x to verify that you don't have any left over processes on each of the hosts that make up your LAM configuration ( host listed in hosts file ). The quick to do that is to run: foreach h ( `cat hosts` ) echo "+++ host $h +++" ssh -q -x $h 'ps -xu' end lamtests -------- If you like to run more sophisticated tests try installing the lamtests suite: cp /usr/local/lam70/lamtests-7.0.tar.gz . Instructions on how to install lam and the test suite: xpdf /usr/local/lam70/mpi7-install.pdf & Conclusion ---------- To find out more on how to use Lam use the Lam man pages with command lman - a very good start point is: lman lam You will find other examples in $LAMHOME directory ie. cd $LAMHOME; ls Enjoy, Peter