User Tools

Site Tools


openmpi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
openmpi [2022/03/25 17:26] – created nicoopenmpi [2022/03/25 17:50] (current) nico
Line 1: Line 1:
 ====== Submit your OpenMPI job with SLURM ====== ====== Submit your OpenMPI job with SLURM ======
  
-OpenMPI is built on Magi with SLURM support. To use OpenMPI, you must load the correspondig [[modules|module]]. Feel free to browse the /softs/modules/compiled/gcc/<gcc_version>/openmpi/ to check available versions of OpenMPI.+OpenMPI is built on Magi with SLURM support. To use OpenMPI, you must load the correspondig [[modules|module]]. Feel free to browse the /softs/modules/compiled/gcc/<gcc_version>/openmpi/ to check available versions of OpenMPI. For example : 
 + 
 +   nicolas.greneche@magi3:~$ module load /softs/modules/compiled/gcc/10.2.1/openmpi/4.1.2 
 + 
 +Then, you can compile your OpenMPI codes : 
 + 
 +   nicolas.greneche@magi3:~$ mpicc -o hellompi hellompi.c 
 + 
 +The last step is to write a submission script for slurm (here run.slurm) : 
 + 
 +   #!/bin/bash 
 +   #SBATCH --job-name=hello 
 +   #SBATCH --output=slurm.out 
 +   #SBATCH --error=slurm.err 
 +   #SBATCH --mail-type=end 
 +   #SBATCH --mail-user=nicolas.greneche@univ-paris13.fr 
 +   #SBATCH --nodes=2 
 +   #SBATCH --ntasks-per-node=2 
 +    
 +   srun ./hellompi 
 + 
 +You can refer to this [[submission_script|documentation]] for more informations on job submission. This run an OpenMPI job on two nodes (--nodes=2) with two tasks per node (--ntasks-per-node=2). it leads to a total of four MPI process (or workers).
openmpi.1648225609.txt.gz · Last modified: 2022/03/25 17:26 by nico