This shows you the differences between two versions of the page.
cluster:30 [2007/08/31 10:24] |
cluster:30 [2007/08/31 10:24] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | \\ | ||
+ | **[[cluster: | ||
+ | => Platform/ | ||
+ | |||
+ | => In all the examples below, '' | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== Jobs ===== | ||
+ | |||
+ | Non-Infiniband! For Infiniband submissions go to [[cluster: | ||
+ | |||
+ | This write up will only focus on how to submit jobs using scripts, meaning in batch mode. There is an interactive mode but in general if you create a script then you have a record of how you submitted your job. | ||
+ | |||
+ | So i'm creating two bash shell scripts (they must be bash shells!). | ||
+ | |||
+ | **myscript** | ||
+ | < | ||
+ | #!/bin/bash | ||
+ | |||
+ | # queue | ||
+ | #BSUB -q idle | ||
+ | |||
+ | # email me (##SUB) or save in $HOME (#SUB) | ||
+ | ##BSUB -o outfile.email | ||
+ | #BSUB -o outfile.err | ||
+ | |||
+ | # unique job scratch dirs | ||
+ | MYSANSCRATCH=/ | ||
+ | MYLOCALSCRATCH=/ | ||
+ | export MYSANSCRATCH MYLOCALSCRATCH | ||
+ | |||
+ | # run my job | ||
+ | ./myjob one-arg two-arg | ||
+ | |||
+ | # label my job | ||
+ | #BSUB -J myLittleJob | ||
+ | </ | ||
+ | |||
+ | The convention '#BSUB -parameter value' passes command line arguments to '' | ||
+ | |||
+ | Other than that, ENV variables are made available to **myjob**, a queue is defined (actually unnecessary as idle is the default queue) and two command line arguments are passed to **myjob**. | ||
+ | |||
+ | **myjob** | ||
+ | < | ||
+ | #!/bin/bash | ||
+ | |||
+ | # pre_exec routine will create scratch dirs | ||
+ | # $MYSANSCRATCH | ||
+ | # $MYLOCALSCRATCH in / | ||
+ | |||
+ | # in home directory | ||
+ | for i in `seq 1 25`; | ||
+ | do | ||
+ | d=`date`; | ||
+ | echo "$i $HOSTNAME $2 $1 $d" >> $MYLOCALSCRATCH/ | ||
+ | done | ||
+ | |||
+ | # retrieve some results | ||
+ | tail $MYLOCALSCRATCH/ | ||
+ | cp $MYSANSCRATCH/ | ||
+ | |||
+ | echo DONE ... these dirs will be removed via post_exec | ||
+ | echo $MYSANSCRATCH $MYLOCALSCRATCH | ||
+ | </ | ||
+ | |||
+ | OK, so my program grabs the date and appends it, with the command line arguments, to a file in the MYLOCALSCRATCH directory. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== bsub and bjobs ===== | ||
+ | |||
+ | Straightforward. | ||
+ | |||
+ | < | ||
+ | [hmeij@swallowtail ~]$ bsub < myscript | ||
+ | Job < | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | [hmeij@swallowtail ~]$ bjobs | ||
+ | JOBID | ||
+ | 1001 hmeij | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | [hmeij@swallowtail ~]$ bjobs | ||
+ | JOBID | ||
+ | 1001 hmeij | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | [hmeij@swallowtail ~]$ bjobs | ||
+ | No unfinished job found | ||
+ | </ | ||
+ | |||
+ | <hi # | ||
+ | |||
+ | < | ||
+ | [hmeij@swallowtail gaussian]$ bjobs -p 13892 | ||
+ | JOBID | ||
+ | 13892 | ||
+ | | ||
+ | </ | ||
+ | |||
+ | ===== bhist ===== | ||
+ | |||
+ | You can query the scheduler regarding the status of your job. | ||
+ | |||
+ | < | ||
+ | [hmeij@swallowtail ~]$ bhist -l 1001 | ||
+ | |||
+ | Job < | ||
+ | | ||
+ | ave in $HOME (# | ||
+ | | ||
+ | | ||
+ | |||
+ | Wed Apr 18 11:28:14: Submitted from host < | ||
+ | | ||
+ | Wed Apr 18 11:28:20: Dispatched to < | ||
+ | Wed Apr 18 11:28:20: Starting (Pid 21569); | ||
+ | Wed Apr 18 11:28:25: Running with execution home </ | ||
+ | / | ||
+ | Wed Apr 18 11:28:25: Done successfully. The CPU time used is 0.0 seconds; | ||
+ | Wed Apr 18 11:28:35: Post job process done successfully; | ||
+ | |||
+ | Summary of time in seconds spent in various states by Wed Apr 18 11:28:35 | ||
+ | PEND | ||
+ | 6 0 5 0 0 0 11 | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Job Ouput ===== | ||
+ | |||
+ | The above job submission yields ... | ||
+ | |||
+ | < | ||
+ | [hmeij@swallowtail hmeij]# ls -l | ||
+ | ... | ||
+ | -rw-r--r-- | ||
+ | -rw-r--r-- | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | and the following email | ||
+ | |||
+ | < | ||
+ | Job < | ||
+ | Job was executed on host(s) < | ||
+ | </ | ||
+ | </ | ||
+ | Started at Wed Apr 18 11:28:20 2007 | ||
+ | Results reported at Wed Apr 18 11:28:25 2007 | ||
+ | |||
+ | Your job looked like: | ||
+ | |||
+ | ------------------------------------------------------------ | ||
+ | # LSBATCH: User input | ||
+ | #!/bin/bash | ||
+ | |||
+ | # queue | ||
+ | #BSUB -q idle | ||
+ | |||
+ | # email me (##SUB) or save in $HOME (#SUB) | ||
+ | ##BSUB -o outfile.email # standard ouput | ||
+ | #BSUB -e outfile.err | ||
+ | |||
+ | # unique job scratch dirs | ||
+ | MYSANSCRATCH=/ | ||
+ | MYLOCALSCRATCH=/ | ||
+ | export MYSANSCRATCH MYLOCALSCRATCH | ||
+ | |||
+ | # run my job | ||
+ | ./myjob one-arg two-arg | ||
+ | |||
+ | # label my job | ||
+ | #BSUB -J myLittleJob | ||
+ | |||
+ | |||
+ | ------------------------------------------------------------ | ||
+ | |||
+ | Successfully completed. | ||
+ | |||
+ | Resource usage summary: | ||
+ | |||
+ | CPU time : | ||
+ | Max Memory : 4 MB | ||
+ | Max Swap : | ||
+ | |||
+ | Max Processes | ||
+ | Max Threads | ||
+ | |||
+ | The output (if any) follows: | ||
+ | |||
+ | DONE ... these dirs will be removed via post_exec | ||
+ | / | ||
+ | |||
+ | |||
+ | PS: | ||
+ | |||
+ | Read file < | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== b'ees ===== | ||
+ | |||
+ | Other '' | ||
+ | |||
+ | **'' | ||
+ | |||
+ | **'' | ||
+ | |||
+ | **'' | ||
+ | |||
+ | **'' | ||
+ | |||
+ | **'' | ||
+ | |||
+ | **'' | ||
+ | |||
+ | **'' | ||
+ | |||
+ | => '' | ||
+ | |||
+ | |||
+ | \\ | ||
+ | **[[cluster: |