Platform LSF Administrator's Primer Version 6.2
Running LSF Jobs
Platform LSF Administrator’s Primer
26
Running LSF Jobs
Contents
◆
“Commands for running LSF jobs (lsrun and bsub)” on page 26
◆
“Submitting batch jobs (bsub)” on page 26
◆
“Displaying job status (bjobs)” on page 27
◆
“Controlling job execution (bstop, bresume, bkill)” on page 27
◆
“Running interactive tasks (lsrun and lsgrun)” on page 28
◆
“Integrating your applications with LSF” on page 28
Commands for running LSF jobs (lsrun and bsub)
You use two basic commands to run jobs through LSF:
◆
bsub submits jobs to LSF Batch. LSF schedules and dispatches jobs to the best
available host based on the scheduling policies you configure in your LSF queues.
◆
lsrun runs an interactive task on the best available host, based on current system
load information gathered by
lim.
For most jobs, all you need to do is add either
lsrun or bsub in front of the job
commands you normally use; there is usually no need to modify job executables or
execution scripts.
See the Platform LSF Reference for complete usage and command options.
Submitting batch jobs (bsub)
bsub
The bsub command submits jobs to LSF queues.
The following command submits a
sleep job to the default queue (normal):
% bsub sleep 60
Job <3616> is submitted to default queue <normal>.
When a job is submitted to LSF, it is assigned a unique job ID, in this case 3616.
You can specify a wide range of job options on the
bsub command. For example, you
can specify a queue, and the job command
sleep is the last option:
% bsub -q short sleep 60
Job <3628> is submitted to queue <short>.
What LSF does
with job output
By default, when the job is finished, LSF sends email with a job report and any output
and error messages to the user account from which the job was submitted. You can
optionally save standard output and standard error to files with the
-o and -e options:
% bsub -q short -o /home/user1/job/output.%J -e /home/user1/job/errors.%J ls -l
Job <3640> is submitted to queue <short>.
This command appends the standard output and standard error of the job to the files
output.3640 and errors.3640 in the jobs subdirectory of the home directory of
user1. The %J variable in the command line is replaced by the job ID when the files
are created, which helps keep track of job output when you run a lot of jobs.
Interactive batch
jobs (bsub -I)
To submit an interactive job through LSF, use the -I option:
% bsub -I ls
Submits a batch interactive job that displays the output of the ls command.