Parallel MATLAB for Multicore and Multinode Systems
by Jeremy Kepner, SIAM Press, 2009
[Please cite this book in all publications that use pMatlab.]
Contributors: Nadya T. Bliss, Jeremy Kepner, Bob Bond, Chansup Byun, Andy Funk, Ryan Haney, Hahn Kim, Julie Mullen, Albert Reuther, Edmund Wong.
DOWNLOAD
REQUEST TO ALL USERS: Please read all of this 7-page manual (especially the section on ERROR HANDLING) before starting to use pMatlab. It is also helpful to read the 7-page MatlabMPI manual (see pMatlab/MatlabMPI/README). PC users should read the 1-page manual for running MatlabMPI on a PC (see pMatlab/MatlabMPI/README.pc)
MATLAB and GNU Octave are popular programming languages for implementing numerical computations and are widely used for algorithm development, simulation, data reduction, testing, and system evaluation. Many of these computations could benefit from faster execution on a parallel computer. There have been many previous attempts to provide an efficient mechanism for running Matlab programs on parallel computers. pMatlab provides a set of data structures and functions that implement distributed arrays. Parallel array programming has proven to be an effective programming style for a wide variety of parallel applications and is consistent with standard Matlab programming style. The primary advantages of distributed array programming are:
REQUIREMENTS
pMatlab uses MatlabMPI (included with pMatlab download) for launching programs and communicating between processors and thus has the following requirements
Because MatlabMPI uses file i/o for communication, there must be a directory that is visible to every machine (this is usually also required in order to install Matlab). This directory defaults to the directory that the program is launched from, but can be changed when you launch your pMatlab program.
AddOne/pAddOne.m
Simple program that performs Y = X + 1.Mandelbrot/pMandelbrot.m
Computes Mandelbrot set.ZoomImage/pZoomImage.m
Zooms in on an image.IO/pIO.m
Demonstrates parallel file IO.Blurimage/pBlurimage.m
Convolves an image.Beamformer/pBeamformer.m
Beamforms sensor data.Speedtest/pSpeedtest.m
Tests message passing performance.Stream/pStream.m
HPC Challenge Stream benchmark.RandomAccess/pRandomAccess.m
HPC Challenge RandomAccess benchmark.FFT/pFFT.m
HPC Challenge FFT benchmark.HPL/pHPL.m
HPC Challenge High Performance Linpack (HPL) benchmark.TestAll/pTestAll.m
Runs all of the above examples.
machines = {};
Run on a local processor.machines = {'machine1' 'machine2'}) );
Run on multiprocessors.machines = {'machine1:dir1' 'machine2:dir2'}) );
Run on multiprocessors and communicate via dir1 and dir2, which must be visible to both machines.
ERROR HANDLING
pMatlab handles errors in the following manner.
MatMPI/*.out.
MPI_AbortIf this doesn't work, you will need to log into each machine, type"top" and kill the Matlab processes one by one. NOTE: pRUN automatically executes MPI_Abort before running the next job.
MatMPI_Delete_all
If this doesn't work, you can delete the files by hand. The files can be found in two places: the launching directory and the communication directory (which by default are the same place). NOTE: pRUN automatically executes MatMPI_Delete_all before running the next job.
In the launch directory, you may have leftover files that look like
MatMPI/*
In the communication directory, you may have leftover files that look like:
p<rank>_p<rank>_t<tag>_buffer.mat
p<rank>_p<rank>_t<tag>_lock.mat
It is very important that you delete these files. In general, if you are using a public directory to do communication (e.g.; /tmp), you should create a subdirectory first (e.g.; /tmp/username) and use this directory for communication.
FILES
Description of files/directories:
README This file startup.m Edit and pass into your ~/matlab/startup.m disclaimer Disclaimer examples/ Directory containing examples and benchmark programs src/ pMatlab source files MatlabMPI/ MatlabMPI library directory (see MatlabMPI/README) PCTstubs Functions for launching on top of MathWorks PCT
pMatlab_intro.pdf Introduction to Parallel Programming and pMatlab pMatlab_v2_param_sweep.pdf Writing Parameter Sweep Applications with pMatlab pMatlab_v2.0.1_func_ref.pdf pMatlab Function Reference pMatlabProgramming.ppt Overview of distributed array concepts
src/
Copyright 2005-2008, Massachusetts Institute of Technology. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MATLAB is a registered MathWorks trademark. Reference to commercial products, tradenames, trademarks, or manufacturer does not constitute or imply endorsement.