Skip to main content

7.5) Shared Memory OpenMP Job Example Submission Script


A simple shared memory job submission script, omp_example.sh, can take the form:

[bash]
#!/bin/bash
# use current working directory and environment
#$ -cwd -V
# request 4 processors within shared memory environment
#$ -pe smp 4
# request 10 hours of runtime
#$ -l h_rt=10:00:00
#request 2G of memory per core
#$ -l h_vmem=2G
# Launch program
./omp_prog
[/bash]

This should then be submitted with:

[bash]
$ qsub omp_example.sh
[/bash]

Note that on ARC2,the memory is specified per core. So in the above example, the script is requesting a total of 8GB of memory, shared between 4 processes.

Recall that on ARC2, the maximum that can be requested in the shared memory environment cannot exceed the resources of a single node, i.e. 16-core and a total of 32GB. For instance, can specify -pe smp 16 and –l h_vmem=2G OR –pe smp 8 and –l h_vmem=4G.