Data Parallelism Example
Setup and Hello World example
The support for OpenMP has improved greatly in recent Gnu C compilers, so use a recent version, at least gcc 4.4 (you get a suitable version on the Beowulf nodes).
from section 3 of
Review the source code and note how OpenMP directives and library routines are being used.
Log on to a multicore machine, e.g.
for parallel execution:
gcc -fopenmp omp_hello.c -o hello
Run with the default number of cores:
Set the number of cores to 4 and rerun:
export OMP_NUM_THREADS=4 ./hello
Phil Trinder 2013-02-28