Operations > Computing > FAQ

Linux Lab Parallel Matlab FAQ

These days, the best way to run parallel jobs in matlab in the linux lab, is to go here, grab the lincoln lab pmatlab tool box, drop it in your home directory and go. Older methods are detailed below for those curious.

We support two of these Matlab multiprocessing toolkits, MPITB and PVMTB. More documentation about these toolkits can be found on their respective homepages: MPI Toolbox for Matlab and PVM Toolbox for Matlab.

Note: The PVM and MPI toolbox instructions below are only relevant to Matlab R12(6.0). Matlab R13 instructions are found further down the page.

PVM Toolbox

All you need to do is first start Matlab, then run the step-by-step tutorial.

Click here to start the PVMTB tutorial Matlab MUST be running

MPI Toolbox

For MPI you need to make sure that the machines you are about to run Matlab on are on. You can do this by running the recon tool.

     recon -v $LAMBHOST

This will tell you if any of the machines are down. If they are then you'll need to create your own hostfile.

     cp $LAMBHOST /condor//hostfile
     vi /condor//hostfile

The file is very simple, all you have to do is remove the machine name that recon complained about. Once you've done that, try recon again - except this time instead of $LAMBHOST use /condor//hostfile

When recon completes its test successfuly run lamboot:

     lamboot -v /condor//hostfile

Now start Matlab, then run the step-by-step tutorial.

Click here to start the MPITB tutorial Matlab MUST be running

Matlab R13 Instructions

For MatlabR13 we are using a toolbox called MatlabMPI, which is available (with instructions) from the page Parallel Programming with MatlabMPI.

Matlab R13 is installed in /usr/local/apps/matlab.r13. Since we are running R12 as the default, to start matlabR13 you would from a command prompt type "matlabR13". MatlabMPI is installed in /usr/local/apps/matlabMPI.

Type "help MatlabMPI" to get a list of all the functions.

Type "help function_name" to get more info on a specific function.

Go to the "examples" directory.

To run from the Matlab command line, first start Matlab then type:

     eval( MPI_Run('xbasic', 2,machines) );
     eval( MPI_Run('basic', 2,machines) );
     eval( MPI_Run('multi_basic',2,machines) );
     eval( MPI_Run('probe', 2,machines) );
     eval( MPI_Run('speedtest', 2,machines) );
     eval( MPI_Run('broadcast', 2,machines) );
     eval( MPI_Run('blurimage', 2,machines) );

Where the machines argument can be one of the following forms:

     machines = {};                                    # If run on a local processor.

     machines = {'machine1' 'machine2'}) );            # If run on multiprocessors.

     machines = {'machine1:dir1' 'machine2:dir2'}) );  # If run on multiprocessors and 
                                                              # communicate via dir1 and dir2,
                                                              # which must be visible to both
                                                              # machines.
EE logo