You use bsub to submit a job to the LSF batch system.
An extensive documentation on the bsub command can be found in the LSF documentation: "<a href="/lsf/lsf_users_guide/index.htm">Running Jobs with Platform LSF</a>"
.
There are some important parameters that are always required or at least recommended to use:
-q <queue> | The queue your job should run in. Available queues. |
-n <processors> | The number of job slots you need (=cores, if no affinity request is given). |
-R 'span[ptile=64] ' -R 'span[hosts=1] ' | Request to always get 64 processor together on one node, i.e. full nodes. If you use 64 processors or less, use '-R 'span[hosts=1] ' instead to ensure all processes running on one node. |
-W <minutes> -W <hour>:<min> | Set the runtime limit of your job (up to the maximum allowed by the selected queue). See the description for host model considerations. |
-app <profile> | Use an application profile to request an amount of memory for each process. More details on memory reservation. |
-I | Run the job interactively, showing you its output directly in your shell session. Useful for debugging or short runs. |
-J <jobname> | Sets an arbitrary name for your job that is used for Email notifications and listing of jobs through bjobs .See also our policy on jobnames. |
-G <groupname> | Specifies group or project name, such that a job is correctly accounted for the given group (important if more than one affiliation of a user is given). |
To specify files for output, error and input consider the following:
-o <filename> | Will direct stdout, stderr and the LSF job summary into one file. |
-o <filename>.log -e <filename>.err | Will direct stdout and the job summary to the log file and stderr to the error log file. |
-N | In addtition to -o will send the job summary seperately within a mail to the user. |
-i <filename> | Specifies additional input data. |
Other important parameters / features on mogon include:
There are two ways to supply parameters and commands to bsub: Using the command line or using a bsub script.
On the command line, you simply attach all parameters to the bsub command and finish with your program:
$ bsub -q short -n 128 -R 'span[ptile=64]' -app Reserve1800M <mpirun/mpiexec> ./cpi
In a bsub script, you list all your bsub parameters in a file as special comments like this:
#BSUB -q short #BSUB -n 128 #BSUB -R 'span[ptile=64]' #BSUB -app Reserve1800M <mpirun/mpiexec> ./cpi
And then you pipe that file into the bsub command like this:
$ bsub < job
A good verification tool for shell scripts can be found here.