So, I’m taking a class this year on high performance computing, and I figure’d I might as well kill two birds with one stone: write some blog posts, and also get some studying done.  Let’s get to it!

What Is OpenMP?

OpenMP is an API for working with shared memory parallel computers.  Essentially everyone now owns one of these machines, as any multi-core machine is a shared memory parallel machine.  What it isn’t is a tool for GPU programming or programming on distributed memory systems (like a Beowulf cluster).

OpenMP is one of the fastest and easiest ways to squeeze extra performance our of modern multicore CPUs.

How to Set Up OpenMP?

Unlike some parallel tools (I’m looking at you CUDA 2 years ago), OpenMP is ridiculously easy to set up.  If you are running a Debian-like system, it is just:

apt-get install libgomp1

And that’s it!  All you need to do now is compile your code, as you normally would, with gcc and the -fopenmp flag

gcc  -fopenmp

How easy is that?

In the next post, we will write some simple C code using OpenMP.