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:
-
http://people.sc.fsu.edu/~jburkardt/presentations/vt_2010_openmp.pdf,
Parallel Programming with OpenMP;
-
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.
-
http://people.sc.fsu.edu/~jburkardt/pdf/OpenMP3.0-FortranCard.pdf,
OpenMP FORTRAN Reference Card
-
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:30 | OpenMP I |
10:30-10:45 | Break |
10:45-12:00 | OpenMP II |
12:00-1:00 | Lunch |
1:00-2:30 | Parallel Matlab |
2:30-2:45 | Break |
2:45-4:00 | Exercises |
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:
-
jEdit, an editor with which you can view and modify the
exercise files and create new ones;
-
WinSCP3, a "secure copy" program that uses a visual interface.
It allows you to log into a remote machine (such as Ithaca), and
then transfer files back and forth by dragging their images.
-
PuTTY, includes a secure shell terminal program PuTTY that
allows you to log into a remote system, and a secure file transfer
program PSFTP that allows you to transfer files back and forth.
If you are using the Macintosh interface on one of the lab machines,
then programs you will need include:
-
TextEdit, an editor with which you can view and modify the
exercise files and create new ones, available in the Applications
folder;
-
Terminal, which opens a Unix command interface, available
in the Applications/Utilities folder;
-
ssh which is a secure shell terminal program that
allows you to log into a remote system. Invoke it from the
Terminal program by
ssh my_id@ithaca2.arc.vt.edu
-
sftp which is a secure file transfer program that
allows you to move files to and from a remote system. Invoke it from the
Terminal program by
sftp my_id@ithaca2.arc.vt.edu
Remote Programs for the OpenMP Exercises:
Remember, to compile your program with OpenMP, you use one of the
following GNU compilers:
-
gcc -fopenmp myprog.c
-
g++ -fopenmp myprog.C
-
gfortran -fopenmp myprog.f
-
gfortran -fopenmp myprog.f90
or one of the Intel compilers:
-
icc -openmp -parallel myprog.c
-
icpc -openmp -parallel myprog.C
-
ifort -openmp -parallel myprog.f
-
ifort -openmp -parallel myprog.f90
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.
-
The Hello Exercise
-
The Quadrature Exercise
-
The Heated Plate Exercise
-
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.
-
Solutions for The Hello Exercise
-
Solutions for The Quadrature Exercise
-
Solutions for The Heated Plate Exercise
-
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.