Sample script
Serial job sample script – sample.sub
#!/bin/bash # Job name #SBATCH --job-name=test-serial # # Set partition [change] #SBATCH --partition=devel # # STDOUT file; "N" is node number and "j" job id number #SBATCH --output=test-serial_%N_%j.out # STDERR file; "N" is node number and "j" job id number #SBATCH --error=test-serial_%N_%j.err # # Number of tasks per node #SBATCH --ntasks=1 # Memory requirement per CPU #SBATCH --mem-per-cpu=1G # # Total wall-time #SBATCH --time=00:05:00 # # To get email alert [Optional] # NOTE: Remove one "#" and "write your email ID" (ex: #SBATCH --mail-user=hemanta.kumar@icts.res.in) ##SBATCH --mail-user= email id ##SBATCH --mail-type=ALL date cd /home/hemanta.kumar/slurm_test ./long_run date
Submit job:
sbatch sample.sub
The job’s status in the queue can be monitored with squeue; (add -u username to focus on a particular user’s jobs).
The job can be deleted with scancel <job_id> .
When the job finishes (in error or correctly) there will normally be one file created in the submission directory with the name of the form slurm-NNNN.out (where NNNN is the job id).