This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
rise:ejemplos:mpi_hello [2020/07/01 01:12] fmorac |
rise:ejemplos:mpi_hello [2020/07/01 01:20] (current) fmorac [SLURM] |
||
|---|---|---|---|
| Line 44: | Line 44: | ||
| ==== SLURM ==== | ==== SLURM ==== | ||
| + | Existen diversas maneras para ejecutar trabajos en SLURM, en este caso se dan dos alternativas: | ||
| + | |||
| + | === srun === | ||
| + | El siguiente comando ejecuta el hello world en la partición tara-2N-1H (-p tara-2N-1H) utilizando 2 nodos (-N 2): | ||
| + | <code bash> | ||
| + | srun -N 2 -p tara-2N-1H hello-world | ||
| + | </ | ||
| + | |||
| + | |||
| + | === sbatch === | ||
| + | Para correr el hello world usando **sbatch** es necesario crear el siguiente archivo: | ||
| + | <code bash hello-world.sbatch> | ||
| + | #!/bin/bash | ||
| + | # | ||
| + | #SBATCH --job-name=mpi-hello-world | ||
| + | #SBATCH --nodes=2 | ||
| + | #SBATCH --ntasks=1 | ||
| + | #SBATCH --time=1:00 | ||
| + | #SBATCH --partition=tara-2N-1H | ||
| + | #SBATCH --output=mpi-hello-world.txt | ||
| + | module load mpi/openmpi | ||
| + | export OMP_NUM_THREADS=2 | ||
| + | mpirun hello-world | ||
| + | </ | ||
| + | Para ejecutar el script de **sbatch** se utiliza: | ||
| + | <code bash> | ||
| + | sbatch hello-world.sbatch | ||
| + | </ | ||