Compilers¶
VSC offers Intel, GCC, AOCC and nvhpc compilers. The available compilers depend on the VSC cluster/partition.
CPU architectures Skylake and Cascadelake¶
These architectures are available in the following nodes/partitions:
- VSC-4 Login nodes l40-l49
- skylake_0096
- skylake_0384
- skylake_0768
- cascadelake_0384
You can choose between these compilers:
- gnu
- intel / oneapi / dpcpp
Info
Usually the intel compilers deliver the best performance on these architectures.
CPU architectures Zen2 and Zen3¶
These architectures are available in the following nodes/partitions:
- VSC-5 Login nodes l50-l56
- zen3_0512
- zen3_1024
- zen3_2048
- zen3_0512_a100x2
- zen2_0256_a40x2
You can choose between these compilers:
- gnu
- intel / oneapi / dpcpp
- aocc only on
zen
- nvhpc only on
cuda-zen
Info
Usually the aocc compiler delivers the best performance on these architectures.
Compiler names¶
Language | Intel | GNU | AOCC |
---|---|---|---|
C | icx |
gcc |
clang |
C++ | icpx |
g++/c++ |
clang++ |
Fortran | ifx |
gfortran |
flang |
Intel compilers¶
Intel compilers for skylake
, zen
, cuda-zen
:
module load intel/19
Intel's OneAPI compilers for skylake
, zen
, cuda-zen
:
module load compiler/latest
GNU compilers¶
GNU compilers for skylake
:
module load gcc/9.5.0-gcc-8.5.0-3wfbr74
GNU compilers for zen
:
module load gcc/13.2.0-gcc-12.2.0-wmf5yxk
GNU compilers for cuda-zen
:
module load gcc/12.2.0-gcc-9.5.0-nu5le4q
AOCC compilers¶
AOCC compilers for skylake
:
None
AOCC compilers only for zen
:
module load aocc/4.1.0-gcc-12.2.0-rir6635
AOCC compilers for cuda-zen
:
None
Info
AOCC compilers do not work with NVidia's cuda package, pick gcc
on cuda-zen
instead.
Compiling serial code examples¶
Intel¶
module load compiler/latest
icx hello.c -o hello_c
GNU¶
On skylake
module load gcc/9.5.0-gcc-8.5.0-3wfbr74
gcc hello.c -o hello_c
zen
module load gcc/13.2.0-gcc-12.2.0-wmf5yxk
gcc hello.c -o hello_c
AOCC¶
On zen
module load aocc/3.2.0-gcc-11.2.0-y53mdzy
clang hello.c -o hello_c
Single-node parallel code with OpenMP¶
Compiling parallel C code with OpenMP using Intel/GNU/AOCC
icx -qopenmp hello_openmp.c -o hello_openmp_c
gcc -fopenmp hello_openmp.c -o hello_openmp_c
clang -fopenmp hello_openmp.c -o hello_openmp_c
And to run it on 2 cores:
export OMP_NUM_THREADS=2
./hello_openmp_c
This works identically on skylake
and cuda-zen
too.
Multi-node parallel code with MPI¶
MPI compiler wrappers¶
Intel OneAPI | Intel | Openmpi | |
---|---|---|---|
package | intel-oneapi-mpi | intel-oneapi-mpi | openmpi |
compiler | compiler/latest |
intel/19 |
any |
C | mpiicc |
mpicc/mpigcc |
mpicc |
C++ | mpiicpc |
mpicxx/mpigxx |
mpic++/mpiCC/mpicxx |
Fortran | mpiifort |
mpifc/mpiifort |
mpifort |
There are other MPI implementations available, for example:
- mpich
- mvapich
- mvapich2
Find MPI implementations¶
For example, one can find all mpi implementations by using grep
with module avail
:
module avail -t | grep mpi
If you search for a specific mpi implementation use module avail
directly:
module avail mpi
module avail intel-oneapi-mpi
module avail openmpi
module avail mvapich
Examples parallel code MPI¶
Compiling MPI C code with Intel and Intel MPI¶
module load compiler/latest
module load intel-oneapi-mpi/2021.7.1-intel-2021.7.1-fzg6q4x
mpiicc -O0 hello-mpi.c -o hello-mpi_c
mpirun -np 2 ./hello-mpi_c
Compiling MPI C code with GNU and Intel MPI¶
module load gcc/9.5.0-gcc-8.5.0-3wfbr74
module load intel-oneapi-mpi/2021.10.0-gcc-9.5.0-jjk5krw
mpicc -O0 hello-mpi.c -o hello-mpi_c
mpirun -np 2 ./hello-mpi_c
Examples: Compiling MPI C code with AOCC and OpenMPI¶
module load aocc/4.1.0-gcc-12.2.0-rir6635
module load openmpi/4.1.4-aocc-4.0.0-x4jtiii
mpicc -O0 hello-mpi.c -o hello-mpi_c
mpirun -np 2 ./hello-mpi_c