Intel oneAPI

Supported versions

Warning

As of version 2024.0, Intel has discontinued the traditional compilers icc, icpc, and ifort. We know that such a decision may affect many code projects that use those compilers and struggle switching to the new LLMV-based compilers icx, icpx, and ifx. To make the transition from classic to LLVM-based compilers easier, we still host some older versions of Intel oneAPI compilers that include the classic compilers. 2023.2.1 is the latest such version. Check the document Porting Guide for ICC Users to DPCPP or ICX for more details about how to move from classic to LLVM-based compilers.

Warning

Do not use Intel MPI on Discoverer compute nodes. That MPI library cannot scale to more than two nodes, and we do not have a clear explanation for that phenomena.

To check which Intel oneAPI versions are currently supported on Discoverer, execute on the login node:

module load intel
module avail

and check the output in the section below /opt/software/intel/oneapi/modulefiles label.

Accessing the compilers

To obtain access to the latest Intel compilers, load the following environment modules:

LLVM-based compilers

The access to the Intel LLVM-based compilers icx, icpx, ifx can be gained by loading the following sequence of environment modules:

module load intel
module load tbb/latest
module load compiler-rt/latest
module load oclfpga/latest
module load compiler/latest

Classic compilers

Warning

Intel has already retired those compilers. This means they won’t get any more updates. Consider switching to Intel’s LLVM-based compilers as soon as possible.

The access to the classic Intel LLVM-based compilers icc, icpc, ifort can be gained by loading the following sequence of environment modules:

module load intel
module load compiler/2023.2.1

DPC++ compiler

Note

Intel oneAPI Data Parallel C++ compiler employs LLVM compiler drivers.

To get access to the latest DPC++ compiler, load the LLVM-based compilers as mentioned above. Then instead or invoking the old dpcpp compiler (it is deprecated and will be removed in a future release), use:

icpx -fsycl

Interoperability with GCC

Note

For advanced users!

You may need to load the latest GCC version to provide more recent C++ support to the compilation process:

module load gcc/latest
module load intel
...

Compiler optimization flags for AMD Zen2 CPU

Note

The compute nodes of Discoverer HPC are equipped with AMD EPYC 7H12 64-Core processors, which implies AMD Zen2 CPU architecture.

The following compiler flags can be useful during the compile-time optimization of your binary code on AMD Zen2:

-march=znver2 -mtune=native

For example:

icx -march=znver2 -mtune=native ...
icpx -march=znver2 -mtune=native ...
ifx -march=znver2 -mtune=native ...

You should be able to tune your code for using AVX2 SIMD instructions (those are the highest SIMD supported by AMD Zen2 kernel). More on the supported compiler flags: AMD EPYC™ 7xx2-series Processors Compiler Options Quick Reference Guide

See also: Best Practice Guide - AMD EPYC.

Interaction with CMake

It is recommended to specify the compiler executables when invoking cmake tool:

-DCMAKE_C_COMPILER=icx
-DCMAKE_CXX_COMPILER=icpx
-DCMAKE_Fortran_COMPILER=ifx

The corresponding optimization compiler flags can be passed to cmake as well:

-DCMAKE_C_FLAGS="-march=znver2 -mtune=native"
-DCMAKE_CXX_FLAGS="-march=znver2 -mtune=native"
-DCMAKE_Fortran_FLAGS="-march=znver2 -mtune=native"

Getting help

See Getting help