Serial Jobs
Running a simple serial test job
This job is very simple; it just sleeps for 60 seconds.
There are sample job submission scripts available to you in the following path /opt/examples/slurm.
We will copy one of these to our home directory, and submit it in this example.
CODE
$ cp /opt/examples/slurm/serial-job.sh ~/serial-job.sh
Job Script
CODE
#!/bin/bash
# Which partition/queue does this job need to run in. Default is 'hsw-fdr'
#SBATCH --partition=hsw-fdr
# How long does my job have to run (HH:MM:SS), # without this option limit is
# 5min
#SBATCH --time=01:00:00
# This is memory need per task (see above). If not specified you will get
# 3GB of RAM per cpu.
#SBATCH --mem-per-cpu=1G
# The descriptive name for your job this potentially will be visible to other
# users on ACTnowHPC
#SBATCH --job-name=serial_test
# the name of the file to write stdout/stderr to. Use %j as a place holder
# for the current job number
#SBATCH --output=serial_test-%j.out
echo "I've start my serial job it's running on"
hostname
echo "Sleeping for 60 seconds"
sleep 60
Options used in this job submission script
#SBATCH --partition=hsw-fdr | Run in the hsw-fdr partition |
#SBATCH --time=01:00:00 | Run for 1 hour |
#SBATCH --mem-per-cpu=1G | I will need 1GB of RAM for my job |
#SBATCH --job-name=serial_test | I'm naming my job "serial_test" |
#SBATCH --output=serial_test-%j.out | Write all the output to a file called serial_test-JOBID.out |
To run the job issue the following command
CODE
$ sbatch serial-job.sh
Submitted batch job 1520
Check the status of the job
Check the status with squeue (more info Basic SLURM commands).
CODE
$ squeue --job 1520