User Tools

Site Tools


slurm

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
slurm [2014/10/14 09:00]
volker [Launch Interactive GPU Jobs (Compiling, Testing)]
slurm [2015/03/24 11:46]
volker
Line 6: Line 6:
   * Cf. [[https://​computing.llnl.gov/​linux/​slurm/​man_index.html]]   * Cf. [[https://​computing.llnl.gov/​linux/​slurm/​man_index.html]]
   * Especially [[https://​computing.llnl.gov/​linux/​slurm/​sbatch.html]]   * Especially [[https://​computing.llnl.gov/​linux/​slurm/​sbatch.html]]
 +
 +===== Basics ======
 +
 +  * Submit batch jobs
 +
 +<​code>​
 +sbatch script.job
 +</​code>​
 +
 +  * View the queue
 +
 +<​code>​
 +squeue
 +</​code>​
  
 ===== Random Tips & Tricks ===== ===== Random Tips & Tricks =====
Line 12: Line 26:
  
 <​code>​ <​code>​
-sattach jobid.jobstep+sattach jobid.jobstep
 </​code>​ </​code>​
 +
 +  * We can hold a job by postponing it's start time [[https://​computing.llnl.gov/​linux/​slurm/​faq.html#​hold]]
 +
 +<​code>​
 +$ scontrol update JobId=1234 StartTime=now+30days
 +... later ...
 +$ scontrol update JobId=1234 StartTime=now
 +</​code>​
 +
 +  * If you want squeue to look like at CSCS, add the following to your .bashrc
 +
 +<​file>​
 +alias squeue="​squeue --format='​%.12i %.8u %.9P %.32j %.12B %.2t %.12r %.14M %.14L %.6D %.10Q'"​
 +</​file>​
  
 ===== Launch Interactive GPU Jobs (Compiling, Testing) ===== ===== Launch Interactive GPU Jobs (Compiling, Testing) =====
Line 20: Line 48:
  
 <​code>​ <​code>​
-salloc -1 --gres gpu:1 --partition tasna --account gpu+salloc --ntasks ​1 --gres gpu:1 --partition tasna --account gpu
 </​code>​ </​code>​
  
Line 28: Line 56:
 srun --pty bash srun --pty bash
 </​code>​ </​code>​
 +
 +  * :!: Always do this from the front-end nodes. As Slurm inherits you're environment,​ CUDA stuff (nvcc, etc) won't be available of you issue this job from other computers.
  
 ===== Example Script for GPU Jobs ===== ===== Example Script for GPU Jobs =====
Line 34: Line 64:
  
 <​file>​ <​file>​
-#​!/​bin/​bash ​                                                                                                ​ +#​!/​bin/​bash 
-#SBATCH --output /​home/​ics/​volker/​Genga/​Jobs/​Debris/Chaos-41/​gas_03/Logs/run_01-%j.out +#SBATCH --output /​home/​ics/​volker/​Genga/​Jobs/​HitnRun/Reufer2012/Logs/cC03m_conex-%j.out 
-#SBATCH --job-name ​c41/gas_03/run_01 +#SBATCH --job-name ​HitnRun/R12/cC03m/ConeX 
-#SBATCH --partition ​tasna+#SBATCH --partition ​vesta
 #SBATCH --account gpu #SBATCH --account gpu
 #SBATCH --ntasks 1 #SBATCH --ntasks 1
 #SBATCH --gres gpu:1 #SBATCH --gres gpu:1
 #SBATCH --time 28-00:00:00 #SBATCH --time 28-00:00:00
-#XSBATCH --exclude=tasna1 +#XSBATCH --exclude=tasna5 
-#SBATCH --mail-user ​volker@cheleb.net +#SBATCH --mail-user ​you@yourdomain.com 
-#SBATCH --mail-type ​ALL+#SBATCH --mail-type ​END
 #SBATCH --no-requeue #SBATCH --no-requeue
  
Line 50: Line 80:
 data=/​zbox/​data/​volker data=/​zbox/​data/​volker
  
-genga=$home/​Source/​genga-dev/​source/​genga_ss_gas_sm20 +genga=$home/​Source/​genga-dev-hitnrun/source/genga_hitnrun_coll24days_sm37 
-outdir=$data/​Debris/​Runs/​Chaos-41/gas_03/run_01+outdir=$data/​HitnRun/Reufer2012/cC03m_conex
  
-echo $genga 
-echo $outdir 
 echo ""​ echo ""​
- 
 echo "***** LAUNCHING *****" echo "***** LAUNCHING *****"
 echo `date '+%F %H:​%M:​%S'​` echo `date '+%F %H:​%M:​%S'​`
 +echo ""​
 +
 +echo "​genga="​$genga
 +echo "​outdir="​$outdir
 +echo "​hostname="​`hostname`
 +echo "​cuda_visible_devices="​$CUDA_VISIBLE_DEVICES
 +
 +echo ""​
 +echo "​***"​
 echo ""​ echo ""​
  
 cd $outdir cd $outdir
 export DATE=`date +%F_%H%M` export DATE=`date +%F_%H%M`
-time srun $genga > Run_$DATE.log+srun $genga > Run_$DATE.log
  
 echo ""​ echo ""​
slurm.txt · Last modified: 2015/03/24 11:47 by volker