BOOTCAMP_2010_VT
OpenMP and Parallel MATLAB


http://people.sc.fsu.edu/~jburkardt/workshops/bootcamp_2010_vt/bootcamp_2010_vt.html

Lecture Notes:

The slides used during the presentations are available online:

  1. http://people.sc.fsu.edu/~jburkardt/presentations/vt_2010_openmp.pdf, Parallel Programming with OpenMP;
  2. http://people.sc.fsu.edu/~jburkardt/presentations/vt_2010_matlab.pdf, Parallel Programming with MATLAB;

Documents:

The following are two reference cards, which briefly list the OpenMP directives, the associated clauses, and their meanings.

  1. http://people.sc.fsu.edu/~jburkardt/pdf/OpenMP3.0-FortranCard.pdf, OpenMP FORTRAN Reference Card
  2. http://people.sc.fsu.edu/~jburkardt/pdf/OpenMP3.0-SummarySpec.pdf, OpenMP C/C++ Reference Card


Tuesday, 10 August, 9:00am-4:00pm

9:00-10:30OpenMP I
10:30-10:45Break
10:45-12:00OpenMP II
12:00-1:00Lunch
1:00-2:30Parallel Matlab
2:30-2:45Break
2:45-4:00Exercises


Local Programs for the OpenMP Exercises:

If you are using the PC interface on one of the lab machines, then you should go to the All Programs menu in order to use the following:

If you are using the Macintosh interface on one of the lab machines, then programs you will need include:


Remote Programs for the OpenMP Exercises:

Remember, to compile your program with OpenMP, you use one of the following GNU compilers:

or one of the Intel compilers: If you leave off the switches, you are compiling without OpenMP.

To set the number of OpenMP threads, use a command like:

export OMP_NUM_THREADS=4
Type this exactly as it is; do not insert any spaces around the equals sign! Note that, on Ithaca, we can only ask for between 1 and 8 threads.

Compilation creates an executable program called a.out. To run it interactively, simply type

./a.out

Interactive execution is OK for small programs and small numbers of processors. However, regular users put their jobs into shell scripts and submit them. For the exercises below, when a shell script is recommended, an example file is supplied. However, to run the shell script, you will need to replace the account information with the account you have been assigned. This is the line that reads

#PBS -A hpcb0001


The OpenMP Exercises:

Each of these exercises studies a particular program, and asks you to carry out several steps, to study a particular aspect of OpenMP programming. The exercises are listed in order of difficulty.

  1. The Hello Exercise
  2. The Quadrature Exercise
  3. The Heated Plate Exercise
  4. The Schedule Exercise


OpenMP Exercise Solutions:

If you get stuck on an exercise, or want to compare your solution with mine, the solutions are discussed here. I did NOT run my solutions on Ithaca, so my timings and your timings will probably differ.

  1. Solutions for The Hello Exercise
  2. Solutions for The Quadrature Exercise
  3. Solutions for The Heated Plate Exercise
  4. Solutions for The Schedule Exercise


Parallel MATLAB Exercises:

Using parallel MATLAB on the Ithaca cluster requires some initial setup that we can't easily do in the lab. However, you can certainly try out parallel MATLAB on your own machine, if you have a multicore machine and are using Virginia Tech's network-licensed version of MATLAB.

The examples discussed in class are available online, and include:


You can go up one level to the main web page.


Last revised on 23 July 2010.