Getting Started on AI and LCS machines


General Information

Getting PPMatlab/Matlab*p up and running on your machine once it's been installed (already done for you on the Bushel of Computing at the AI Lab as well as the Xolas and Pleiades clusters at the Supercomputing Group in LCS) is a just a little bit more involved than typing a single command. The PPServer makes extensive use of MPI and shared libraries. Immediately below, we describe the general procedure for using the PPServer. Afterwords, discuss in detail what is necessary to use the PPServer on the AI and LCS clusters.

Required information

You will need to know the following bits of information:

  1. How to start up an MPI program. On most platforms it is mpirun. For the rest of this document, MPIRUN will denote the program, whatever its name.
  2. Where the Matlab*p binaries are installed. The person who installed the system will most likely know this. We will refer to this directory as BINDIR.
  3. Where the Matlab*p Matlab scripts are installed. We subsequently refer to this place as SCRIPTSDIR.
The Environment

The next stop involves setting some environment variables. You should add BINDIR as well as the directories containing MPIRUN and Matlab to your $PATH, as necessary. Generally the latter are already accessible via your $PATH.

Your $LD_LIBRARY_PATH should also contain BINDIR as well as any other directories that might contain packages, including those that you might create for yourself. If MPI requires shared libraries that are not in standard locations, you must also add these to your $LD_LIBRARY_PATH. Generally, this is not necessary, but some MPI implementations may require it. Finally, you should put SCRIPTSDIR in your $MATLABPATH.

Running Matlab*p

There are two main ways to start Matlab*p. Perhaps the most flexible way is to execute the command:

MPIRUN -np p [other MPI options] ppmatlabserver -beparent $DISPLAY [other options]

where p denotes the number of processors that you wish to use. Notice the use of the environment variable $DISPLAY.

There are several other possible options to ppmatlabserver. Perhaps the most important one is: -log. The -log option specifies a file (or standard error) where PPServer logging messages will be written. This is often very useful, especially in debugging stages. As a result, we often execute a command like:

MPIRUN -np p [other MPI options] ppmatlabserver -beparent $DISPLAY -log ~/pplog

or

MPIRUN -np p [other MPI options] ppmatlabserver -beparent $DISPLAY -log -

which sends logging information to ~/pplog and standard error (i.e. the screen), respectively.

In any case, a Matlab window will appear on your display and you are on your way. You might find it useful to create an alias or shell script that sets up the necessary variables and automatically runs Matlab*p in one command (one example is below).

Alternatively, you can skip all this by simply executing Matlab in an environment where the PPServer may be executed. This may be useful for aesthetic reasons or for situations where popping up a window isn't appropriate (such as when you're running a script).

If the environment variable $PPCOMMLINE is present, you can use the PPServer from within Matlab without directly starting it up. Simply strt Matlab normally. The first time a PPServer command is encountered, the PPServer Matlab will execute the command in the $PPCOMMLINE environment variable automatically.

The form of this command is slightly different than the one used to execute PPServer directly. In particular, it looks like:

MPIRUN -np %d [other MPI options] ppmatlabserver -bechild %d [other options]

Here the character sequence "%d" is treated like C-style directives for indicating that an integer will be substitued in its place. In particular, the first %d will be replaced with the number of processors to be used (either explicitly defined in the environment variable $PPPROCS or implicitly assumed to be 2) while the second will be replaced with the process id of the Matlab process, determined at run-time.

Site-Specific Information

Currently Matlab*p is running happily on two clusters of SMPs in the LCS Supercomputing Group; namely, the Xolas clusters and Pleiades. It is also running on the AI Bushel of Computing (ABC). Here we provide information on running the PPServer on these platforms.

Required information/The Environment

Xolas:
BINDIR = /homes/ppserver/bin
SCRIPTSDIR = /homes/ppserver/matlab
$PATH = $PATH:BINDIR
$LD_LIBRARY_PATH = $LD_LIBRARY_PATH:BINDIR:/hpc/SUNWhpc/lib
$MATLABPATH = $MATLABPATH:SCRIPTSDIR

Pleiades:
BINDIR = /homes/ppserver/bin
SCRIPTSDIR = /homes/ppserver/matlab
$PATH = $PATH:BINDIR
$LD_LIBRARY_PATH = $LD_LIBRARY_PATH:BINDIR
$MATLABPATH = $MATLABPATH:SCRIPTSDIR

Bushel of Computing:
BINDIR = /homes/ppserver/bin
SCRIPTSDIR = /homes/ppserver/matlab
$PATH = $PATH:BINDIR
$LD_LIBRARY_PATH = $LD_LIBRARY_PATH:BINDIR
$MATLABPATH = $MATLABPATH:SCRIPTSDIR

Running Matlab*p

Xolas:
MPIRUN = tmrun

Pleiades:
MPIRUN = dmpirun

Bushel of Computing:
Executing mpi programs on the Bushel of Computing is not as straightforward as it is on other platforms.

To begin with, MPI must be explicitly started using the lamboot program. This requires setting up a host file that indicates which machines you might want to define as a cluster. We recommend reading the man page for lamboot for complete information; however, you can also just execute the command:

lamboot myhosts

where myhosts is a file where each line contains a full machine name. For example myhosts might look like:

---
lv01.ai.mit.edu
lv02.ai.mit.edu
lv03.ai.mit.edu
lv04.ai.mit.edu
---

To then execute Matlab*p simply use:

mpirun -w -c p ppmatlabserver -- -beparent $DISPLAY [other options]

Note the use of both "-w" and "-c" (in place of "-np"). Note also the double dash "--" before the -beparent option.

In order for this command to execute correctly, your .rhosts file must be explicitly set up to include the machines you wish to be in your cluster. Finally, to shut down a lamboot session, use:

wipe myhosts

The file /homes/ppserver/.cshrc provides an example of how to set up one's environment correctly for the ABC. Similarly, a sample script, ppmatlab is available in /homes/ppserver. Given the number of processors to use and a host file, it calls lamboot on a particular host file, starts up the server, and then calls wipe. In reality, there is no need to kill lamboot everyone time. It may be called once, and PPServers may then be started and ended any number of times.

Again, we recommend making use of the man pages.


For help, questions and information send email to:
ppserver-help@ai.mit.edu

You can also join the ppserver mailing list:
ppserver-request@ai.mit.edu

http://www.ai.mit.edu/projects/ppserver