submission_script
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
submission_script [2021/09/01 17:34] – nico | submission_script [2021/11/17 22:29] – nico | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | A submission file script contains all the information required by SLURM in order to launch your job. We will detail a versy simple script that launch | + | ===== Simple job script ===== |
+ | |||
+ | A submission file script contains all the information required by SLURM in order to launch your job. We will detail a very simple script that launch | ||
+ | |||
+ | nicolas.greneche@magi1: | ||
+ | # | ||
+ | #SBATCH --job-name=hostname | ||
+ | #SBATCH --output=slurm.out | ||
+ | #SBATCH --error=slurm.err | ||
+ | #SBATCH --mail-type=end | ||
+ | #SBATCH --mail-user=nicolas.greneche@univ-paris13.fr | ||
+ | #SBATCH --nodes=2 | ||
+ | |||
+ | srun hostname | ||
+ | |||
+ | We submit this script with " | ||
+ | |||
+ | nicolas.greneche@magi1: | ||
+ | Submitted batch job 44066 | ||
+ | |||
+ | And we check the output : | ||
+ | |||
+ | nicolas.greneche@magi1: | ||
+ | magi66 | ||
+ | magi75 | ||
+ | |||
+ | ===== OpenMP job script ===== | ||
+ | |||
+ | Here is a simple script for OpenMP : | ||
+ | |||
+ | nicolas.greneche@magi1: | ||
+ | # | ||
+ | #SBATCH --job-name=OMP_hello | ||
+ | #SBATCH --output=slurm.out | ||
+ | #SBATCH --error=slurm.err | ||
+ | #SBATCH --partition=COMPUTE-SHORT | ||
+ | #SBATCH --nodes=1 | ||
+ | #SBATCH --ntasks-per-node=1 | ||
+ | #SBATCH --cpus-per-task=4 | ||
+ | |||
+ | export OMP_NUM_THREADS=4 | ||
+ | srun hello_openmp | ||
+ | |||
+ | We submit it : | ||
+ | |||
+ | nicolas.greneche@magi1: | ||
+ | Submitted batch job 44075 | ||
+ | |||
+ | And check the output : | ||
+ | |||
+ | nicolas.greneche@magi1: | ||
+ | Thread 0 says: Hello World on core 6 | ||
+ | Thread 0 reports: the number of threads are 4 | ||
+ | Thread 1 says: Hello World on core 32 | ||
+ | Thread 3 says: Hello World on core 1 | ||
+ | Thread 2 says: Hello World on core 14 | ||
+ | |||
+ | ===== MPI job script ===== | ||
+ | |||
+ | nicolas.greneche@magi1: | ||
+ | # | ||
+ | #SBATCH --job-name=hello | ||
+ | #SBATCH --output=slurm.out | ||
+ | #SBATCH --error=slurm.err | ||
+ | #SBATCH --nodes=2 | ||
+ | #SBATCH --ntasks-per-node=2 | ||
+ | |||
+ | srun ./ | ||
+ | |||
+ | We submit it : | ||
+ | |||
+ | nicolas.greneche@magi1: | ||
+ | Submitted batch job 44082 | ||
+ | |||
+ | And check the output : | ||
+ | |||
+ | nicolas.greneche@magi1: | ||
+ | Hello world from process 1 of 4 at magi66 | ||
+ | Hello world from process 3 of 4 at magi75 | ||
+ | Hello world from process 0 of 4 at magi66 | ||
+ | Hello world from process 2 of 4 at magi75 |
submission_script.txt · Last modified: 2021/11/17 22:30 by nico