1. Home
  2. Contra Cluster
  3. Submitting serial jobs

Submitting serial jobs

Sample script

Serial job sample script – sample.sub


# 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=3
# Total wall-time
#SBATCH --time=00:05:00
# To get email alert [Optional] NOTE: remove below two lines if email alert not required
#SBATCH --mail-user=hemanta.kumar@icts.res.in
#SBATCH --mail-type=ALL

cd /home/hemanta.kumar/slurm_test
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).

Submit script flags

ResourceFlag SyntaxDescriptionNotes
job name--job-name=hello_testName of jobdefault is the JobID
partition--partition=develPartition is a queue for jobsdefault partition maked with *, devel is the default partition on Mario
time--time=01:00:00Time limit for the job. Acceptable time formats include minutes, minutes:seconds, hours:minutes:seconds, days-hours, days-hours:minutes and days-hours:minutes:secondshere it is given as 1 hour
nodes--nodes=2Number of compute nodes for the jobdefault is 1 compute node
cpus/cores--ntasks-per-node=8Corresponds to number of cores on the compute nodedefault is 1 task per node
memory--mem=32000Memory limit per compute node for the job. Do not use with mem-per-cpu flagby default memory in MB
memory per CPU--mem-per-cpu=1000per core memory limit. Do not use with mem flagby default memory in MB
output file--output=test.outName of file for stdoutdefault is the JobID
error file--error=test.errName of file for stderrdefault is the JobID
email address--mail-user=username@buffalo.eduUser's email addresssend email on submition and complition of job OR omit for no email
email notification--mail-type=ALL –mail-type=ENDWhen email is sent to user.omit for no email
Was this article helpful to you? Yes No 1