BIRTHDAY_REMOTE
Remote Execution of a Parallel MATLAB Program


BIRTHDAY_REMOTE is a directory of MATLAB programs which illustrate how to submit a parallel MATLAB program to run on a remote machine.

Before remote submission of jobs is possible, you must have an account on the remote machine, and go through some steps to ensure that that machine and your desktop machine can communicate properly. If you have not carried out these steps, refer to the document "Notes on Enabling Remote Submission of MATLAB Jobs" listed in the references below.

The underlying program, birthday.m, simply assigns birthdays to each member in a group, then checks if any pair has a common birthday.

The intermediate program birthdayscript.m calls birthday.m many times, carrying out a Monte Carlo investigation to estimate the probability of this event for a variety of group sizes.

The higher level program brunbirthday.m uses MATLAB's BATCH command to submit a job that carries out birthdayscript either on your local desktop, or else on a remote system - in particular, Virginia Tech's ITHACA cluster.

This example illustrates the use of the BATCH command. "brunbirthday" is implemented as a function rather than a script, so that we can wait for the job to complete before retrieving the result and setting the return value of prob.

Usage:

Start up MATLAB on your desktop. Under the Parallel Menu, make sure you have selected either the "local" configuration, or the configuration that corresponds to a remote machine on which you wish to run the job. Then, at the MATLAB prompt, type

prob = brunbirthday ( nw )
where

The BATCH command is arguably more useful in cases where the user wants the batch job to "run in the background" - so that the user can continue interacting with MATLAB while that particular calculation is going on. If you want to experiment with this way of working, then instead of issued the "brunbirthday" command, you can issue the following command (which is actually part of brunbirthday!):

my_job = batch('birthdayscript','FileDependencies','birthday.m', ... 'matlabpool', nw);
from the MATLAB comand window, assuming that you have set nw to the desired number of workers. The job will be worked on in the background. In order for you to check to see if it is finished, issue the command
state = get ( my_job, 'state' )
The value of state will tell you the job's status.

Related Data and Programs:

COLLATZ_PARALLEL is a MATLAB program which seeks the maximum Collatz sequence between 1 and N; it runs in parallel using MATLAB's "parfor" facility.

COLOR_REMOTE, a MATLAB program which carries out the color segmentation of an image in parallel, via SPMD commands; this includes instructions on how to run the job, via MATLAB's BATCH facility, on a remote system such as Virginia Tech's ITHACA cluster.

FDI_OPT, a MATLAB program which demonstrates the use of MATLAB's FMINCON constrained minimization function, taking advantage of MATLAB's Parallel Computing Toolbox for faster execution.

JTB_CODIST, a MATLAB program which demonstrates how the linear system associated with a finite element problem can be treated as a codistributed array whose entries are assigned to different MATLAB workers, so that the matrix is assembled in parallel.

KNAPSACK_REMOTE, a MATLAB program which runs in parallel, seeking solutions of the "subset sum" version of the knapsack problem. Instructions are available on how to run the job, via MATLAB's BATCH facility, on a remote system such as Virginia Tech's ITHACA cluster.

LINEAR_SOLVE_DISTRIBUTED is a MATLAB program which solves a linear system A*x=b using MATLAB's spmd facility, so that the matrix A is "distributed" across multiple MATLAB workers.

LYRICS_REMOTE, a MATLAB program which runs in parallel, using three workers which cooperate "systolically", that is, as through they were on an assembly line. The output from worker 1 is passed to worker 2 for further processing, and so on. This includes instructions on how to run the job, via MATLAB's BATCH facility, on a remote system such as Virginia Tech's ITHACA cluster.

MATLAB_COMMANDLINE, MATLAB programs which illustrate how MATLAB can be run from the UNIX command line, that is, not with the usual MATLAB command window.

MATLAB_PARALLEL, examples which illustrate "local" parallel programming on a single computer with MATLAB's Parallel Computing Toolbox.

MD_PARALLEL is a MATLAB program which carries out a molecular dynamics simulation in parallel, using MATLAB's "PARFOR" feature.

MD_REMOTE, a MATLAB program which carries out a molecular dynamics simulation; it runs in parallel using MATLAB's "parfor" facility, and includes instructions on how to run the job, via MATLAB's BATCH facility, on a remote system such as Virginia Tech's ITHACA cluster.

PRIME_NUMBER_PARALLEL is a MATLAB program which counts the number of primes between 1 and N; it runs in parallel using MATLAB's "parfor" facility.

PRIME_NUMBER_SPMD is a MATLAB program which counts the number of primes between 1 and N; running in parallel using MATLAB's "SPMD" feature.

QUAD_SPMD is a MATLAB program which estimates an integral using quadrature; running in parallel using MATLAB's "SPMD" feature.

SATISFIABILITY_PARALLEL is a MATLAB program which demonstrates, for a particular circuit, an exhaustive search for solutions of the circuit satisfiability problem, running in parallel using MATLAB's "PARFOR" feature.

TIMING_PARALLEL is a directory of MATLAB programs which illustrates how to time a parallel MATLAB program.

Reference:

MathWorks documentation for the Parallel Computing Toolbox is available at http://www.mathworks.com/products/parallel-computing/.

Examples and Tests:

You can go up one level to the MATLAB source codes.


Last revised on 28 October 2009.