Skip to content

Instantly share code, notes, and snippets.

@janxkoci
Last active April 5, 2023 11:57
Show Gist options
  • Select an option

  • Save janxkoci/0b2b6467f15c907a7d07c78cbd0f2ffe to your computer and use it in GitHub Desktop.

Select an option

Save janxkoci/0b2b6467f15c907a7d07c78cbd0f2ffe to your computer and use it in GitHub Desktop.
convenience scripts for Torque PBS submission system (keep them in $HOME/bin)
#!/bin/bash
## Launch interactive session for testing purposes (Torque PBS & PBS Pro / OpenPBS)
# set CPUs and RAM (defaults = 8, 16gb)
cores=${1:-8}
ram=${2:-16}
## Torque PBS
qsub -I -N ijob -d . -v PATH -l nodes=1:ppn=${cores},mem=${ram}gb,walltime=48:00:00
## PBS Pro / OpenPBS
#qsub -I -N ijob -l select=1:ncpus=${cores}:mem=${ram}gb,walltime=24:00:00
#cd $PBS_O_WORKDIR || exit
#!/bin/bash
## Quickly submit a script (Torque PBS)
script=$1
# set CPUs and RAM (defaults = 20, 64gb)
cores=${2:-20}
ram=${3:-64}
## Torque PBS
qsub -N $script -d . -v PATH -l nodes=1:ppn=${cores},mem=${ram}gb,walltime=300:00:00 $script
## PBS Pro / OpenPBS
#qsub -N $script -l select=1:ncpus=${cores}:mem=${ram}gb,walltime=48:00:00 $script
#cd $PBS_O_WORKDIR || exit
@janxkoci
Copy link
Author

janxkoci commented Feb 22, 2022

qsub docs

The documentation for the qsub command of Torque PBS can be found here: html / pdf.

Another documentation I've found (as a backup, in case the other one goes down) is here.

@janxkoci
Copy link
Author

Update

  • more sensible defaults
  • added optional parameter to ijob.sh to set number of CPU cores (defaults to 8)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment