Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In a strictly OMP job (for hybrid jobs see the How-to Submit a Hybrid Job article) the number of nodes will always be 1.  We will leave the number of tasks-per-node set to its default value of 1 as this option is best reserved for controlling the number of MPI processes.  So the number of cpus-per-task will control the number of physical CPU cores reserved for our job.  Most nodes on Talapas have 28 physical CPU cores per node (dual E5-2690v4 Intel chips).  Let's reserve all of them for our job:

Code Block
languagetextbash
#!/bin/bash
#SBATCH --partition=short   ### Partition
#SBATCH --job-name=HelloOMP ### Job Name
#SBATCH --time=00:10:00     ### WallTime
#SBATCH --nodes=1           ### Number of Nodes
#SBATCH --ntasks-per-node=1 ### Number of tasks (MPI processes)
#SBATCH --cpus-per-task=28  ### Number of threads per task (OMP threads)
#SBATCH --account=hpcrcf    ### Account used for job submission

export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK

./hello_omp

...