/
Hybrid Jobs
Hybrid Jobs
A hybrid job uses both OpenMP and MPI for parallelization. This requires the number of tasks and CPUs per task to be set up correctly. Here is an example of such a job. We will use Intel MPI in this example, but this also works using OpenMPI.
Code
Compilation
This can be compiles with both the Intel or the GNU compiler.
Compilation With the Intel Compiler
module load intel module load impi mpiicc -qopenmp -Wl,-rpath,$LD_RUN_PATH -o hybrid_hello_world.bin hybrid_hello_world.c
Compilation with the GNU Compiler
module load gcc module load impi mpigcc -fopenmp -Wl,-rpath,$LD_RUN_PATH -o hybrid_hello_world.bin hybrid_hello_world.c
Batch Job
Job Script
#!/bin/bash #SBATCH --time=00:10:00 #SBATCH --nodes=2 #SBATCH --tasks-per-node=4 #SBATCH --cpus-per-task=10 #SBATCH --partition=standard96:test module load impi export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK srun ./hybrid_hello_world.bin
Related articles
Related content
OpenMP on CPU CLX
OpenMP on CPU CLX
More like this
Multiple programs multiple data
Multiple programs multiple data
More like this
OpenMPI on CPU Genoa
OpenMPI on CPU Genoa
More like this
Parallel programming day 04-2023
Parallel programming day 04-2023
More like this
OpenMPI
OpenMPI
More like this
OpenMPI on CPU CLX
OpenMPI on CPU CLX
More like this