Zum Ende der Metadaten springen
Zum Anfang der Metadaten

Sie zeigen eine alte Version dieser Seite an. Zeigen Sie die aktuelle Version an.

Unterschiede anzeigen Seitenhistorie anzeigen

« Vorherige Version anzeigen Version 5 Nächste Version anzeigen »

Content

Code execution

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


Code compilation

For code compilation please use gnu compiler.

MPI, gnu
module load gcc/13.3.0
module load openmpi/gcc/5.0.3
mpicc -Wl,-rpath,$LD_RUN_PATH -o hello.bin hello.c
MPI, OpenMP, gnu
module load gcc/13.3.0
module load openmpi/gcc/5.0.3
mpicc -fopenmp -Wl,-rpath,$LD_RUN_PATH -o hello.bin hello.c

Slurm job script

A slurm script is submitted to the job scheduler slurm. It contains

  • the request for compute nodes of a CPU Genoa partition and
  • commands to start your binary. You have two options to start an MPI binary.
    • using mpirun
    • using srun

Using mpirun

Using mpirun (from the MPI library) to start the binary you need to switch off slurm binding by adding export SLURM_CPU_BIND=none.

MPI, full node
#!/bin/bash
#SBATCH --nodes=2
#SBATCH --partition=cpu-genoa
module load openmpi/gcc/5.0.3
export SLURM_CPU_BIND=none
mpirun -np 384 --map-by ppr:192:node ./hello.bin

You can run one code compiled with MPI and OpenMP. The example covers the setup

  • 2 nodes,
  • 8 processes per node, 24 threads per process.
MPI, OpenMPI, full node
#!/bin/bash
#SBATCH --nodes=2
#SBATCH --partition=cpu-genoa
module load openmpi/gcc/5.0.3
export SLURM_CPU_BIND=none
export OMP_NUM_THREADS=24
mpirun -np 16 --map-by ppr:8:node:pe=24 ./hello.bin

Using srun

MPI, full node
#!/bin/bash
#SBATCH --nodes=2
#SBATCH --partition=cpu-genoa
srun --ntasks-per-node=192 ./hello.bin

You can run one code compiled with MPI and OpenMP. The example covers the setup

  • 2 nodes,
  • 8 processes per node, 24 threads per process.
MPI, OpenMP, full node
#!/bin/bash
#SBATCH --nodes=2
#SBATCH --partition=cpu-genoa
export OMP_PROC_BIND=spread
export OMP_NUM_THREADS=24
srun --ntasks-per-node=8 --cpus-per-task=48 ./hello.bin
  • Keine Stichwörter