Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

Content

Inhalt

Code execution

For examples for code execution, please visit Slurm CPU Genoa partition CPU CLX.

Code compilation

Codeblock
titleSerial gcc
collapsetrue
module load gcc
gcc -o hello.bin hello.c
gfortran -o hello.bin hello.f90
g++ -o hello.bin hello.cpp

...

Codeblock
titleOpenMP gcc
collapsetrue
module load gcc
gcc -fopenmp -o hello.bin hello.c
gfortran -fopenmp -o hello.bin hello.f90
g++ -fopenmp -o hello.bin hello.cpp

Slurm job script

The examples for slurm job scripts, e.g. myjobscipt.slurm, that cover the setup

...

Codeblock
titleOpenMP, full node
collapsetrue
#SBATCH --nodes=1
#SBATCH --partition=cpu-genoa
export OMP_PROC_BIND=spread
export OMP_NUM_THREADS=96192
./hello.bin


Codeblock
titleOpenMP, half nodehyperthreading
collapsetrue
#SBATCH --nodes=1
#SBATCH --partition=cpu-genoa
export OMP_PROC_BIND=spread
export OMP_NUM_THREADS=48384
./hello.bin
Codeblock
titleOpenMP, hyperthreading
collapsetrue
#SBATCH --nodes=1
#SBATCH --partition=cpu-clx:test
export OMP_PROC_BIND=spread
export OMP_NUM_THREADS=192
./hello.bin

You can run different OpenMP codes at the same time. The examples cover the setup

  • 2 nodes,
  • 4 OpenMP codes run simultaneously.
  • The code is not MPI parallel. mpirun is used to start the codes only.
Codeblock
titleOpenMP simultaneously
collapsetrue
#SBATCH --nodes=2
#SBATCH --partition=cpu-genoa
module load impi/2019.5
export SLURM_CPU_BIND=none
export OMP_PROC_BIND=spread
export OMP_NUM_THREADS=48
mpirun -ppn 2 \
       -np 1 ./code1.bin : -np 1 ./code2.bin : -np 1 ./code3.bin : -np 1 ./code4.bin
Codeblock
titleOpenMP simultaneously hyperthreading
collapsetrue
#SBATCH --nodes=2
#SBATCH --partition=cpu-genoa
module load impi/2019.5
export SLURM_CPU_BIND=none
export OMP_PROC_BIND=spread
export OMP_NUM_THREADS=96
mpirun -ppn 2 \
       -np 1 ./code1.bin : -np 1 ./code2.bin : -np 1 ./code3.bin : -np 1 ./code4.bin