OpenMP Parallel Computing

OpenMP is available on the Linux HPC clusters. To build/run your OpenMP code, please follow the details below.

  1. Parallelize your code using OpenMP. If you are new to OpenMP, there are some useful guides in the links below.
  2. Login to the cluster head nodes (atlas4-c01, atlas5-c01, atlas6-c01 or atlas7-c01,), compile the program and link to the OpenMP libraries.

    Compile C/C++ program:
     icc -openmp hello.c -o hello

    Compile Fortran program:
    >  ifort -openmp hello.f -o hello

    Set the number of threads variable OMP_NUM_THREADS at command line

    > export OMP_NUM_THREADS=8 (for bash shell)
    > setenv OMP_NUM_THREADS 8 (for csh/tcsh shell)

    or through runtime library omp_set_num_threads.

    Run the executable:
    >  ./hello

  3. For long running OpenMP jobs please submit your jobs to LSF queues.To run jobs on atlas4, atlas5, atlas6 or atlas7 clusters, submit to the specific queue on the cluster as atlas4_parallel, atlas5_parallel, atlas6_parallel and atlas7_parallel queue (or atlas4_parallel_test and atlas5_parallel_test etc for testing only).>  bsub –q atlas7_parallel -o stdout.o ./helloAlternate, you can submit the job to queue “openmp”, using a maximum of 8 threads.>  bsub –q openmp -o stdout.o ./hello
  4. Some useful websites for OpenMP:
    http://www.openmp.org/
    http://en.wikipedia.org/wiki/OpenMP
    http://www.msi.umn.edu/tutorial/scicomp/general/openMP/content_openMP.html
    http://www.llnl.gov/computing/tutorials/openMP/
    http://www.llnl.gov/computing/tutorials/openMP/exercise.html