command

Specifies the command and arguments used for the job submission.

Synopsis

bsub [options] command [arguments]

Description

The job can be specified by a command line argument command, or through the standard input if the command is not present on the command line. The command can be anything that is provided to a UNIX Bourne shell (see sh(1)). command is assumed to begin with the first word that is not part of a bsub option. All arguments that follow command are provided as the arguments to the command. Use single quotation marks around the expression if the command or arguments contain special characters.

The job command can be up to 4094 characters long for UNIX and Linux or up to 255 characters for Windows. If no job name is specified with -J, bjobs, bhist and bacct displays the command as the job name.

If the job is not given on the command line, bsub reads the job commands from standard input. If the standard input is a controlling terminal, the user is prompted with bsub> for the commands of the job. The input is terminated by entering CTRL-D on a new line. You can submit multiple commands through standard input.

The commands are executed in the order in which they are given. bsub options can also be specified in the standard input if the line begins with #BSUB; for example, #BSUB -x. If an option is given on both the bsub command line, and in the standard input, the command line option overrides the option in the standard input. The user can specify the shell to run the commands by specifying the shell path name in the first line of the standard input, such as #!/bin/csh. If the shell is not given in the first line, the Bourne shell is used. The standard input facility can be used to spool a user's job script; such as bsub < script.

Examples

bsub sleep 100

Submit the UNIX command sleep together with its argument 100 as a job.

bsub my_script

Submit my_script as a job. Since my_script is specified as a command line argument, the my_script file is not spooled. Later changes to the my_script file before the job completes may affect this job.

bsub < default_shell_script

where default_shell_script contains:

sim1.exe
sim2.exe

The file default_shell_script is spooled, and the commands are run under the Bourne shell since a shell specification is not given in the first line of the script.

bsub < csh_script

where csh_script contains:

#!/bin/csh
sim1.exe
sim2.exe

csh_script is spooled and the commands are run under /bin/csh.

bsub -q night < my_script

where my_script contains:

#!/bin/sh
#BSUB -q test
#BSUB -m "host1 host2" # my default candidate hosts
#BSUB -f "input > tmp" -f "output << tmp"
#BSUB -D 200 -c 10/host1
#BSUB -t 13:00
#BSUB -k "dir 5"
sim1.exe
sim2.exe

The job is submitted to the night queue instead of test, because the command line overrides the script.

bsub> sleep 1800
bsub> my_program
bsub> CTRL-D

The job commands are entered interactively.