ICOM 5995
Performance Instrumentation and Visualization for High Performance Computer Systems
Department of Electrical & Computer Engineering
University of Puerto Rico – Mayaguez
Fall 2002

Using LAM on Amadeus

Updated: October 9, 2002

Links

LAM/MPI page

Lam introductory tutorial

LAM Examples directory (This is a tar file. To extract use tar xvf examples.tar)

 

Lam on the Amadeus cluster

LAM Hosts

There are a total of 8 lam hosts (clients). This are: aramana, netlab02, albizu, netlab04, yuisa, netlab03, bayrex, betances. There is no particular order. You must be connected to one of these eight machines to use LAM. If connecting from outside the university, you must connect to ece.uprm.edu to get to these machines.

Generate SSH keys (only done the first time you use LAM)

To be able to work with the system you will need to generate SSH authentication keys, so the remote node will let you execute something without an interactive login.

 

1. ssh-keygen -t rsa

acepte los defaults

no coloque un passphrase

2. cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys

3. Log to every node of the lam topology.

Paths

The path for lam and related tools is: /opt/perf/lam/bin and /opt/perf/pg/bin. You will need to add this to your $HOME/.bash_profile and $HOME/.bashrc files. Both .bash_profile and .bashrc contain the same information. Here you can find an example of a .bashrc file.

 

After this you can know play with lam.

Booting LAM

Create a file called lamhosts. This file will contain the names of the machines where you want your code to run. It must contain the name of the machine you are connected to. An example of the contents of your lamhosts file is:

# A 4-node LAM on AMADEUS

aramana.ece.uprm.edu

albizu.ece.uprm.edu

betances.ece.uprm.edu

yuisa.ece.uprm.edu

 

This file must be located in the same directory where you want to run your application. Notice that a comment line starts with #.

 

Use lamboot –v lamhosts to start lam on the nodes you specified on your lamhosts file. If you type lamboot –v without specifying the lamhosts file, you will boot lam on all the nodes in the cluster. Notice that having a lamhosts file will allow you to control where will lam run. This is specially useful when you have one node down or if you have too many people working in the lab and the nodes are slow.

 

You might also use the commands recon -v lamhosts or tping -c1 N as explained in the Lam introductory tutorial.

Compiling

If using C, compile using

mpicc –o ExecutableName SourceCode.c

If using Fortran, compile using

mpif77 –o ExecutableName SourceCode.f

Running a program

Use mpirun –np NumberOfNodes ExecutableName to execute your program. If the NumberOfNodes exceeds the number of processors started by lamboot, then multiple copies of the program will run on one node. If no nodes are given, all booted LAM nodes will be considered.

Ending a session

Cleaning LAM

All user processes and messages can be removed, without rebooting using lamclean –v. Use this when you end a program and will run another one. This will NOT halt LAM, that is, LAM will still be running.

Terminating LAM

To terminate LAM use lamhalt. Logging out from your account will NOT halt LAM. Do not leave processes running around.

 

To view your processes, use ps –u YourUserName.

 

If everything else fails, use wipe -v lamhosts.

Example

This example will get name of the cpu where each process is running. Compile using

mpicc –o processorname processorname.c

Try mpirun –np 8 processorname and then mpirun –np 10 processorname.