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
, multiple selections available, Use left or right arrow keys to navigate selected items