Page tree

Versions Compared

Key

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

...

Code Block
languagebash
titleExample of a PBS wrapper for R-script
linenumberstrue
#### The script below needs to be submitted using qsub






#PBS -l walltime=24:00:00,ncpus=64,mem=32gb 

function hms {
 local S=${1}
 ((h=S/3600))
 ((m=S%3600/60))
 ((s=S%60))
 printf "%dh:%dm:%ds\n" $h $m $s
}

    DATE1=$(date +%s)
    Rscript /data/home/johndoe/analysis/run1/my_awesome_script.r  
    DATE2=$(date +%s)
    echo "Time needed: " hms $[ $DATE2 - $DATE1 ]
    
    CURRENT_DIR=$(dirname "$0")
    CURRENT_DIR=$PWD

...