OpenMP Jobs under MOAB / Torque

This is an example script for running an OpenMP application under MOAB/Torque.

There are at least two items you have to specify:

  • The number of cores you request for the job.
  • The name and options of your program.
# General options
#PBS -N OpenMPjob
# stdout/stderr redirection
# ask for cores on one node - it's a SMP job
# we can later refer to this setting through PBS_NUM_PPN
#PBS -l nodes=1:ppn=4
# specify the wall clock time (16 hours)
#PBS -l walltime=16:00:00

# Execute the job from  the  current  working  directory

# set OMP_NUM_THREADS _and_ export!

# ------------------------------- Program_name_and_options
your_openmp_program [options]

If you make use of special environment variables for your OpenMP program, remember to put them in your script (use the same syntax as the OMP_NUM_THREADS line in the script).