How to submit jobs to LSF¶
You can submit jobs to LSF using different queues. Follow the instructions in this guide for different methods.
Things to note when submitting jobs on the HPC
- You must use the login nodes as a portal to the HPC for the submission of jobs, the login nodes have not been designed to handle the processing of data directly.
- Unauthorised tools will not be permitted to run on the login nodes and, if they are found to be running, will be terminated without warning.
- Memory management is enforced on the HPC. This is to safeguard against rogue jobs consuming all the available memory on a node and crashing that node for everyone. When a job is submitted, you will need to specify -
R rusage[mem=<memory_in_mb>]
and-M <memory_in_mb>
.-R
informs LSF of how much memory you wish to consume, and-M
will terminate your job if you consume more memory than asked for. Each CPU has an allocation of 16GB (16000 Mb) of memory, so in order to use larger amounts, you will need to ask for additional CPUs with -n. For example, to ask for 32GB of RAM, the following flags should be used:-R rusage[mem=32000] -M 32000 -n 2
. If-R
and-M
re not specified, default values of-R rusage[mem=1000]
and-M 2000
will be added to your job.
Interactive vs batch jobs¶
Interactive jobs are jobs that you interact with either via:
- command-line
- GUI
- Jobs that stay connected to a submission shell
Interactive command-line jobs in the HPC have a dedicated queue (name of the queue is inter
) with dedicated resources during core hours for faster dispatch. These sessions should be closed as soon as they are no longer required.
Batch jobs are jobs that you don’t interact with. The job is disconnected from submission shell.
Jobs are batch by default
Submitting a job interactively¶
To submit an interactive LSF job, use the command bsub:
bsub -q inter -P <project_code> -o <output.stdout> -e <output.stderr> -R rusage[mem=<memory_in_mb>] -M <max_memory_in_mb> <myjob>
Submitting a script as a job¶
To submit an LSF job using a script use the following template:
Use the following command to submit the script:
bsub < myscript.sh
Note the <
sign above indicating that your script is fed into the submission command.
Files output.stdout
and output.stderr
are file names of your choice where any messages, warnings and errors will be logged.
Project codes¶
For a list of all LSF queues and project codes see LSF Project Codes. You can also see what queues are assigned to you using:
bugroup -w | grep <your_username> | awk '{print $1}'
You will only be able to submit to queues that you have LDAP access to.
For more on how to submit jobs, see Advanced Job Submission Guidelines.
Queues available¶
Genomics England HPC queues are time based queues (short, medium, long). This means you need to submit the jobs to the queue that reflects the runtime of your job.
Queue name | Who | LDAP group | Description |
---|---|---|---|
inter | ALL | N/A | This queue is for lightweight interactive or GUI tools. The queue has a per-user concurrent job limit of five |
short | external | discovery_lsf_access, GECIP_lsf_access, research_lsf_access | This queue is for jobs with maximum RUNTIME of four hours |
medium | external | discovery_lsf_access, GECIP_lsf_access, research_lsf_access | This queue is for jobs with maximum RUNTIME of 24 hours |
long | external | discovery_lsf_access, GECIP_lsf_access, research_lsf_access | This queue is for jobs with unlimited RUNTIME (default to seven days if not specified - or specify the limit as -W [hours:]minutes ) |
To see all available queues in the grid, run bqueues
Some basic LSF commands¶
command | description |
---|---|
bsub |
submits a job to the cluster |
bqueues |
shows info on the cluster queues |
bjobs |
shows info on the cluster jobs |
bhosts |
shows info on the cluster hosts |
bhist |
shows info on the finished cluster jobs |
bacct |
shows statistics and info on finished cluster jobs |
bkill |
removes a job from the cluster |
lshosts |
shows static resource info |
lsload |
shows dynamic resource info |
bjobs
is a very handy command to view job information (both pending and running jobs). Using the long option (-l
), it shows high level view of why (in case of job pending in the queue), where, turnaround time, resource usage detail (for running jobs)
Usage:
bjobs -l <JOBID>
<JOBID>
is the job number generated when you submit you job. You can always get access to the ID of your running jobs by running a simple bjobs
command.