Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section


Column
width50%

Example 1:

The following PBS script requests 1 CPU core, 2GB of memory, and 24 hours of walltime for the running of "paup -n input.nex".

No Format
#!/bin/bash
#PBS -j oe
#PBS -m ae
#PBS -N JobName1
#PBS -l ncpuswalltime=1:pmem=2gb24:00:00
#PBS -l walltimeselect=241:00:00ncpus=1:pmem=2gb
#PBS -M yourFIRSTNAME.name@jcuLASTNAME@jcu.edu.au

cd $PBS_O_WORKDIR
shopt -s expand_aliases
source /etc/profile.d/modules.sh
echo "Job identifier is $PBS_JOBID"
echo "Working directory is $PBS_O_WORKDIR"

module load paup
paup -n input.nex

If the file containing the above content has a name of JobName1.pbs, you simply execute qsub JobName1.pbs to place it into the queueing system.

Example 3:

The following PBS script requests 20 CPU cores, 60GB of memory, and 10 days of walltime for running of an MPI job. Note that the pmem request is per core.

No Format
#!/bin/bash
#PBS -j oe
#PBS -m ae
#PBS -N JobName3
#PBS -l ncpuswalltime=20:pmem=3gb240:00:00
#PBS -l walltimeselect=2401:00:00ncpus=20:pmem=3gb
#PBS -M yourFIRSTNAME.name@myLASTNAME@my.jcu.edu.au


cd $PBS_O_WORKDIR
shopt -s expand_aliases
source /etc/profile.d/modules.sh
echo "Job identifier is $PBS_JOBID"
echo "Working directory is $PBS_O_WORKDIR"

module load openmpi
module load migrate
mpirun -np 20 -machinefile $PBS_NODEFILE migrate-n-mpi ...

If the file containing the above content has a name of JobName3.pbs, you simply execute qsub JobName3.pbs to place it into the queueing system.


Column
width50%

Example 2:

The following PBS script requests 8 CPU cores, 24GB 32GB of memory, and 3 hours of walltime for running of 8 MATLAB jobs in parallel.

No Format
#!/bin/bash
#PBS -j oe
#PBS -m ae
#PBS -N JobName2
#PBS -l pmem=3gbwalltime=3:00:00
#PBS -l nodesselect=1:ppnncpus=8
#PBS -l walltime=3:00:00:pmem=4gb
#PBS -M yourFIRSTNAME.LASTNAME@my.name@jcujcu.edu.au

cd $PBS_O_WORKDIR
shopt -s expand_aliases
source /etc/profile.d/modules.sh
echo "Job identifier is $PBS_JOBID"
echo "Working directory is $PBS_O_WORKDIR"

module load matlab
matlab -r myjob1 &
matlab -r myjob2 &
matlab -r myjob3 &
matlab -r myjob4 &
matlab -r myjob5 &
matlab -r myjob6 &
matlab -r myjob7 &
matlab -r myjob8 &
wait    # Wait for background jobs to finish.

If the file containing the above content has a name of JobName2.pbs, you simply execute qsub JobName2.pbs to place it into the queueing system.

Example 4:

The following PBS script requests request uses job arrays. If you aren't proficient with bash scripting, using job arrays could be painful. The example below has each sub-job requesting 1 CPU core, 1 GB of memory, and 20 minutes of walltime.

No Format
#!/bin/bash
#PBS -j oe
#PBS -m ae
#PBS -N ArrayJob
#PBS -l pmem=1gb
#PBS -l nodeswalltime=120:ppn=100
#PBS -l walltime=20:00select=1:ncpus=1:pmem=1gb
#PBS -M yourFIRSTNAME.name@myLASTNAME@jcu.jcu.edu.au

cd $PBS_O_WORKDIR
shopt -s expand_aliases
source /etc/profile.d/modules.sh

module load matlab
matlab -r myjob$PBS_ARRAYID

If the file containing the above content has a name of ArrayJob.pbs and you will be running 32 sub-jobs, you simply use qsub -t 1-32 ArrayJob.pbs to place it into the queueing system.

Note: I haven't done extensive testing of job arrays.


Brief Details on some extra PBS/Torque directives

...