Child pages
  • openMP
Skip to end of metadata
Go to start of metadata

openMP

OpenMP (Open Multi-Processing) is an API that supports multi-platform shared memory multiprocessing programming in C, C++, and Fortran on most processor architectures and operating systems. It consists of a set of compiler directives, library routines, and environment variables that influence run-time behavior. See both http://en.wikipedia.org/wiki/OpenMP and http://openmp.org/wp/.

No specific module needs to be loaded to use openMP, but you must use a compiler that supports it, and set a flag to correctly identify the number of processing nodes available.

 

Categories for this software 
What is openMPOpenMP (Open Multi-Processing) is an API that supports multi-platform shared memory multiprocessing programming in C, C++, and Fortran on most processor architectures and operating systems.
How to useopenMP is free to use.

To Use

 

Example: g++ compiler
module load gcc/4.5.3
g++  myprog.cpp -fopenmp

Then in the MSG submission script : 

#$ -pe smp 8
export OMP_NUM_THREADS=$NSLOTS

 

This example above requests the queueing system for an 8-core node to run the OpenMP job. The NSLOTS variable will automatically get the value of 8.

Example. Intel compiler
module load intel/2013.3
icc  -openmp myprog.cpp

Then in the MSG submission script :

#$ -pe smp 8
export OMP_NUM_THREADS=$NSLOTS

Further Examples.

Further information can be found at:

https://computing.llnl.gov/tutorials/openMP/exercise.html

  • No labels