This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
quick:pbspro [2015/05/08 13:06] dane [Example 6 : job array] fixed link to correct higher section |
quick:pbspro [2025/09/22 17:47] (current) kevin [Example 4 : empty job] |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Job submission using PBSPro ====== | ====== Job submission using PBSPro ====== | ||
| - | As of January 2014, CHPC has a new scheduler - PBSPro. | + | The CHPC system uses the PBSPro |
| - | Main user documentation can be found at http://resources.altair.com/ | + | Main user documentation can be found at [[https://www.altair.com/ |
| But here is a summary of how to submit jobs at CHPC. | But here is a summary of how to submit jobs at CHPC. | ||
| Line 26: | Line 26: | ||
| A script can include just about anything which you could do during a terminal session such as set environment variables, change directories, | A script can include just about anything which you could do during a terminal session such as set environment variables, change directories, | ||
| - | '' | + | > Job script files can be named to anything allowed for a regular file, but it is strongly recommended that you use '' |
| Line 50: | Line 50: | ||
| '' | '' | ||
| + | |||
| + | ====How to monitor job arrays==== | ||
| + | |||
| + | To see the array job status on the queue, postfix the | ||
| + | jobnumber with empty square brackets: | ||
| + | |||
| + | '' | ||
| + | |||
| + | |||
| + | To look at one specific job in the array, add '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | |||
| + | eg | ||
| + | |||
| + | '' | ||
| + | |||
| Line 58: | Line 76: | ||
| ====Job Exit Codes >= 128 (or 256)==== | ====Job Exit Codes >= 128 (or 256)==== | ||
| - | This means the job was killed | + | This means the job was killed by the PBS scheduler by sending it a signal. |
| - | The exit status values greater than 128 (or 256) indicate which signal killed the job. Depend- ing on the system, values greater than 128 (or on some systems 256; see man wait(2) for more information), | + | |
| - | To interpret (or “decode”) | + | The **modulo** or **remainder** operator [[http:// |
| + | |||
| + | The signal is given by X modulo 128 (or 256). An exit value of 137 means the job's top process was killed with signal 9 because '' | ||
| + | |||
| + | Depending on the system, a value greater than 128 or 256, see '' | ||
| + | |||
| + | Exit code 271 means that the job exceeded the limit requested at submission, eg. walltime or cpu usage, and was killed. | ||
| + | |||
| + | See '' | ||
| ====Terminate a job by signal==== | ====Terminate a job by signal==== | ||
| Send a signal to the job | Send a signal to the job | ||
| Line 84: | Line 109: | ||
| - | ===== Example 2 (a) : Amber job on GPU nodes (NB: For other executables e.g. python and sender, see example 2(b)) ===== | + | ===== Examples: Amber jobs ===== |
| - | < | ||
| - | #!/bin/sh | ||
| - | #PBS -N eric.job | ||
| - | #PBS -l select=1: | ||
| - | #PBS -l walltime=1: | ||
| - | #PBS -q kepla_k20 | ||
| - | #PBS -m be | ||
| - | #PBS -o / | ||
| - | #PBS -e / | ||
| - | #PBS -M email@mail.com | ||
| - | cd $PBS_O_WORKDIR | + | [[howto: |
| - | pwd | ||
| - | echo "My job starts here" | ||
| - | date | ||
| - | source / | ||
| - | module add intel-XE/ | ||
| - | module add amber/k20 | ||
| - | exe=pmemd.cuda.MPI | ||
| - | nproc=`cat $PBS_NODEFILE|wc -l` | ||
| - | time mpirun -np $nproc -machinefile $exe -O -i mdin -o mdout -p prmtop -c inpcrd | ||
| - | echo "My job ends here" | ||
| - | date | ||
| - | </ | ||
| - | ===== Example | + | ===== Example: |
| - | < | ||
| - | #!/bin/sh | ||
| - | #PBS -N eric.job | ||
| - | #PBS -l select=1: | ||
| - | #PBS -l walltime=1: | ||
| - | #PBS -q workq | ||
| - | #PBS -m abe | ||
| - | #PBS -o / | ||
| - | #PBS -e / | ||
| - | #PBS -M email@mail.com | ||
| - | cd $PBS_O_WORKDIR | + | [[howto: |
| - | pwd | ||
| - | |||
| - | source / | ||
| - | module add intel-XE/ | ||
| - | |||
| - | echo "My job starts here" | ||
| - | date | ||
| - | |||
| - | exe=sander.MPI | ||
| - | |||
| - | nproc=`cat $PBS_NODEFILE|wc -l` | ||
| - | time mpirun -np $nproc -machinefile $exe -O -i mdin -o mdout -p prmtop -c inpcrd | ||
| - | echo "My job ends here" | ||
| - | date | ||
| - | </ | ||
| - | |||
| - | ===== Example 3 : Quantum Espresso job ===== | ||
| - | |||
| - | < | ||
| - | #!/bin/sh | ||
| - | ###These lines are for PBSpro | ||
| - | #PBS -N QEspresso | ||
| - | #PBS -l select=2: | ||
| - | #PBS -l walltime=24: | ||
| - | #PBS -q workq | ||
| - | #PBS -m be | ||
| - | #PBS -o / | ||
| - | #PBS -e / | ||
| - | #PBS -V | ||
| - | ##### Environment Settings | ||
| - | source / | ||
| - | module add intel-XE/ | ||
| - | module add QEspresso/ | ||
| - | ##### Running commands | ||
| - | NP=`cat $PBS_NODEFILE | wc -l` | ||
| - | cd $HOME/ | ||
| - | mpirun -f $PBS_NODEFILE -r ssh -ib -env I_MPI_DEBUG 2 -np $NP pw.x -npool 3 -inp inputfile.inp | ||
| - | </ | ||
| ===== Example 4 : empty job ===== | ===== Example 4 : empty job ===== | ||
| Line 186: | Line 141: | ||
| #< | #< | ||
| #< | #< | ||
| - | #< | + | #< |
| #< | #< | ||
| Line 193: | Line 148: | ||
| </ | </ | ||
| - | //Note that the M9000 sparc queue is called ' | + | |
| ===== Example 5 : MPI example ===== | ===== Example 5 : MPI example ===== | ||
| Line 205: | Line 160: | ||
| ... | ... | ||
| </ | </ | ||
| - | |||
| - | ===== Example 6 : job array ===== | ||
| - | See [[howto: | ||
| - | <file bash simple_job_array.pbs> | ||
| - | #! /bin/bash | ||
| - | #PBS -l select=1: | ||
| - | #PBS -l walltime=00: | ||
| - | #PBS -o / | ||
| - | #PBS -e / | ||
| - | #PBS -M youremail@address.com | ||
| - | #PBS -m abe | ||
| - | #PBS -N J_example | ||
| - | #PBS -J 1-24 | ||
| - | |||
| - | |||
| - | # Make sure we're in the right working directory | ||
| - | cd / | ||
| - | |||
| - | #sleep a random number of seconds (<10) | ||
| - | sleep $[ ( $RANDOM % 10 ) + 1 ]s | ||
| - | |||
| - | #see what happens when we write to a file... | ||
| - | echo " | ||
| - | echo " | ||
| - | echo " | ||
| - | </ | ||
| - | |||
| - | Thing to note: the stdout and stderr outputs do not all get joined together as they might with an mpi job. | ||
| - | |||
| ===== Further examples ===== | ===== Further examples ===== | ||
| * Various [[howto: | * Various [[howto: | ||
| * This [[howto: | * This [[howto: | ||