Using OpenMP

You can use Omni OpenMP a free, portable OpenMP implementation for C.

Compile, and run

The command to compile OpenMP C programs is omcc, located at /local/amza/omnimp/bin on the Linux machines (magenta, etc). However, as you know, the Linux machines are uniprocessor machines. If you would like to install Omni OpenMP on a different platform, please download the Omni OpenMP code from  Omni OpenMP and install it yourselves. For your convenience you can find the tar file of the download also in /local/amza/omnimp.tar on the Linux machines. 

To run the OpenMP program, just execute the compiled executable on your platform. The number of processor (or operating system threads) used is controlled by either setenv OMPC_NUM_PROCS 4 or export OMPC_NUM_PROCS=4, depending on which shell you use.

One useful omcc flag is -X. It generates tmp.c, a multithread program translated from OpenMP. The name  of all parallel functions generated by the compiler  starts with __ompc_func.

Examples

Some OpenMP examples for the applications we have been using, including Molecular Dynamics (md) are on the web page under Programming Assignments.