LSF Version 7.3 - Administering Platform LSF

Administering Platform LSF 599
Interactive Jobs with bsub
Writing a job file one line at a time
UNIX example % bsub -q simulation
bsub> cd /work/data/myhomedir
bsub> myjob arg1 arg2 ......
bsub> rm myjob.log
bsub> ^D
Job <1234> submitted to queue <simulation>.
In the above example, the 3 command lines run as a Bourne shell (/bin/sh) script.
Only valid Bourne shell command lines are acceptable in this case.
Windows example C:\> bsub -q simulation
bsub> cd \\server\data\myhomedir
bsub> myjob arg1 arg2 ......
bsub> del myjob.log
bsub> ^Z
Job <1234> submitted to queue <simulation>.
In the above example, the 3 command lines run as a batch file (.BAT). Note that only
valid Windows batch file command lines are acceptable in this case.
Specifying job options in a file
In this example, options to run the job are specified in the options_file.
% bsub -q simulation < options_file
Job <1234> submitted to queue <simulation>.
UNIX On UNIX, the options_file must be a text file that contains Bourne shell
command lines. It cannot be a binary executable file.
Windows On Windows, the options_file must be a text file containing Windows batch file
command lines.
Spooling a job command file
Use bsub -Zs to spool a job command file to the directory specified by the
JOB_SPOOL_DIR parameter in
lsb.params, and use the spooled file as the
command file for the job.
Use the
bmod -Zsn command to modify or remove the command file after the job
has been submitted. Removing or modifying the original input file does not affect
the submitted job.
Redirecting a script to bsub standard input
You can redirect a script to the standard input of the bsub command:
% bsub < myscript
Job <1234> submitted to queue <test>.
In this example, the myscript file contains job submission options as well as
command lines to execute. When the
bsub command reads a script from its
standard input, it can be modified right after
bsub returns for the next job
submission.
When the script is specified on the
bsub command line, the script is not spooled:
% bsub myscript
Job <1234> submitted to default queue <normal>.