Skip to content

Instantly share code, notes, and snippets.

@explodecomputer
Last active November 3, 2015 14:38
Show Gist options
  • Save explodecomputer/46cea01f64c501ddcb0c to your computer and use it in GitHub Desktop.
Save explodecomputer/46cea01f64c501ddcb0c to your computer and use it in GitHub Desktop.
Example submission script for bluecrystal3
#!/bin/bash
#PBS -N test
#PBS -o test-output
#PBS -e test-error
#PBS -t 1-500
#PBS -l walltime=5:00:00
#PBS -l nodes=1:ppn=1
#PBS -S /bin/bash
set -e
echo "Running on ${HOSTNAME}"
# If there is an argument passed at commandline then set PBS_ARRAYID as that
# Else, PBS_ARRAYID is either empty if run in commandline,
# or set by the job scheduler if run by qsub
if [ -n "${1}" ]; then
echo "${1}"
PBS_ARRAYID=${1}
fi
i=${PBS_ARRAYID}
# Analysis
R --no-save --args ${i} < test.R
# Pass arguments from shell to R
arguments <- commandArgs(T)
i <- as.numeric(arguments[1])
print(i)
@explodecomputer
Copy link
Author

To run a test (e.g. for process 1 of 500) in the frontend of bluecrystal, type:

chmod 755 submit.sh
./submit.sh 1

Otherwise just submit and it will make 500 jobs

qsub submit.sh

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