Porting with OpenMP

Article ID: 103
Last updated: 31 Dec, 2025

Building Applications

To build an OpenMP application, you need to use the -qopenmp Intel compiler flag:

%module load comp-intel
%ifort -o your_executable -qopenmp program.f

Running Applications

The maximum number of OpenMP threads that an application can use on a compute node depends on:

  • The number of physical processor cores in the node
  • Whether hyperthreading is available and enabled

With hyperthreading, the operating system views each physical core as two logical processors, and can therefore assign two threads per core. This is beneficial only when one thread does not keep the functional units in the core busy all the time and can share the resources in the core with another thread. Running in this mode may take less than twice the wall time compared to running only one thread on the core.

Hyperthreading technology is available and enabled on all Electra and Aitken processor types. See the following table for the maximum number of threads possible on each processor type:

Processor Type Maximum Threads
without Hyperthreading
Maximum Threads
with Hyperthreading
Broadwell 28 56
Skylake 40 80
Cascade Lake 40 80
Rome 128 256
Milan 128 256
TIP: Hyperthreading does not benefit all applications. Also, some applications may show improvement with some process counts but not with others, and there may be other unforeseen issues. Therefore, before using this technology in your production run, you should test your applications with and without hyperthreading. If your application runs more than twice as slow with hyperthreading than without, do not use it.

Here is sample PBS script for running OpenMP applications on a NAS Skylake node without hyperthreading:

#PBS -lselect=1:ncpus=40:ompthreads=40:model=sky_ele, walltime=1:00:00

module load comp-intel

cd $PBS_O_WORKDIR

./your_executable

Here is sample PBS script with hyperthreading:

#PBS -lselect=1:ncpus=40:ompthreads=80:model=sky_ele, walltime=1:00:00

module load comp-intel

cd $PBS_O_WORKDIR

./your_executable

Contact Us

General User Assistance

Security

  • Report security issues 24x7x365
  • Toll-free: 1-877-NASA-SEC (1-877-627-2732)
  • E-mail: soc@nasa.gov

User Documentation

High-End Computing Capability (HECC) Portfolio Office

NASA High-End Computing Program

Tell Us About It

Our goal is furnish all the information you need to efficiently and effectively use the HECC resources needed for your NASA computational projects.

We welcome your input on features and topics that you would like to see included on this website.

Please send us email with your wish list and other feedback.