Here's what to do: On some lab machine: % ssh-keygen -t dsa (accept the defaults, and just hit RETURN when asked for a passphrase) % cd ~/.ssh % cat id_dsa.pub >> authorized_keys2 now try it out: ssh somemachinenameNext, set your LAMRSH environment variable:
# if you use bash: add to your .bashrc or .bash_profile file: export LAMRSH=ssh # if you use another shell (you likely don't) add to your .cshrc file: setenv LAMRSH sshThe main steps that you will need to take to run MPI programs are the following:
% recon -v lamhosts # see the example below for this file's formatThen, to boot lam on the hosts in your host file (this has to be once at the beginning of each session you run mpi programs):
% lamboot -v lamhosts
% mpicc -o myprog myprog.c
% cat appfile # 18 a.outs across 6 nodes (will spawn 3 a.outs per node) n0-5 /home/newhall/lam/test/a.out n0-5 /home/newhall/lam/test/a.out n0-5 /home/newhall/lam/test/a.out % mpirun -v appfileor use the
-np #
command line option to mpirun
to specify the number of processes to start on the nodes. For more
options, see the mpirun man page.
% mpirun -np 25 /home/newhall/lam/test/a.out
% lamclean -v
# every 1 second, run mpitask % watch -n 1 mpitask
% lamhalt % lamwipe -v lamhosts
% mkdir lam % cd lam % vi lamhosts # add some hosts % recon -v lamhosts % lamboot -v lamhosts % tping -c1 N % cp -r /usr/share/doc/lam3-dev/examples/main/mandelbrot . % cd mandelbrot/ % gunzip *.gz % mpicc -o master master.c % mpicc -o slave slave.c % vi appfile # create appfile schema file: it describes # the application: each node and program # the node names come from 'recon -v lamhosts' % cat appfile # 1 master, 5 slaves n0 master n1-5 slave % mpirun -v appfile # run the MPI application % xv mandel.out % lamclean -v # clean up lam stuff from this run % mpirun -v appfile # re-run the mandelbrot app % lamhalt -v # halt lam...you are done running lam apps % lamwipe -v ../lamhosts (if halt didn't work)Try running this application with different numbers of slaves by modifying the appfile, and login to a node running slave programs, run top, and watch as slave program(s) are spawned and start running.