CSCI 3366 (Introduction to Parallel and Distributed Processing), Fall 2006:
Using OpenMP on the Linux Lab Machines

As of this year, the version of the GNU compilers installed on the lab machines includes support for the OpenMP extensions, so you should be able to compile and run OpenMP programs on any of our machines. (How interesting it is depends in part on how many processors the machine has. Note that the parallel-programming cluster installed last year includes two dual-processor machines, Dione01 and Dione02, and one four-processor machine, Dione00.)

Compiling OpenMP programs

Use the command gcc with the -fopenmp flag to compile C programs with OpenMP extensions. Typical usage:

gcc -fopenmp -o foo foo.c

See the sample programs page for a Makefile.

Running OpenMP programs

To execute the compiled program, just type the name of the executable. Recall from class that you can temporarily set an environment variable for a program on the command line. Example usages:

foo

foo arg1 arg2

OMP_NUM_THREADS=10 foo



Berna Massingill
2006-08-25