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.
#!/bin/sh # General options # #PBS -N OpenMPjob # stdout/stderr redirection #PBS -o $PBS_JOBNAME.$PBS_JOBID.out #PBS -e $PBS_JOBNAME.$PBS_JOBID.err # 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 cd $PBS_O_WORKDIR # set OMP_NUM_THREADS _and_ export! OMP_NUM_THREADS=$PBS_NUM_PPN export OMP_NUM_THREADS # ------------------------------- 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).