bsub

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
bsub [2020/07/07 16:37]
jrutte02 removed
— (current)
Line 1: Line 1:
-====== bsub ====== 
  
-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:​ <​html>"<​a href="/​lsf/​lsf_users_guide/​index.htm">​Running Jobs with Platform LSF</​a>"</​html>​. 
- 
-===== Important parameters ===== 
- 
-There are some important parameters that are always required or at least recommended to use: 
- 
-| ''​-q <​queue>''​ | The queue your job should run in.\\ [[queues|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 [[queues|queue]]). See [[runtime|the description]] for host model considerations.| 
-| ''​-app <​profile>''​ | Use an application profile to request an amount of memory for each process.\\ [[memory_reservation|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 ''​[[submit_and_manage_jobs_on_mogon_quickstart#​jobs_bjobs|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: 
- 
-  * Using the [[ramdisk|ramdisk]] 
-  * Using [[local_scratch|Local scratch space]] 
-  * Specifying runtimes in accordance with [[runtime|host models or host names]] 
-  * Using [[lsf_gpu|GPU Queues]] 
- 
- 
- 
-===== Using bsub ===== 
- 
-There are two ways to supply parameters and commands to bsub: Using the command line or using a bsub script. 
- 
-==== Command line ==== 
- 
-On the command line, you simply attach all parameters to the bsub command and finish with your program: 
- 
-<code bash> 
-$ bsub -q short -n 128 -R '​span[ptile=64]'​ -app Reserve1800M <​mpirun/​mpiexec>​ ./cpi 
-</​code>​ 
- 
-==== bsub script ==== 
- 
-In a bsub script, you list all your bsub parameters in a file as special comments like this: 
- 
-<file bash job> 
-#BSUB -q short 
-#BSUB -n 128 
-#BSUB -R '​span[ptile=64]'​ 
-#BSUB -app Reserve1800M 
- 
-<​mpirun/​mpiexec>​ ./cpi 
-</​file>​ 
- 
-And then you pipe that file into the bsub command like this: 
- 
-<code bash> 
-$ bsub < job 
-</​code>​ 
- 
-A good verification tool for shell scripts can be found [[http://​www.shellcheck.net/​|here]].