There are many times when users may need to execute their programs multiple times, particularly when random number generation is being used.
The following sample script can be found on the HPC system at /apps/samples/multi-submit/multi-submit.sh
which can be copied your home directory (as well as the hello.exe
program executable) for use. Some general notes:
$PBS_O_WORKDIR
indicates the directory where the PBS script file is located and launched from.for ((i=1; i<=10; i+=1))
" and replacing the 10 value with a value of your choice.Multi-Job_[$1]
, where $1 is the jobnumber. You may wish to change the jobname to something different, but note that PBS has a jobname limit of 10 characters.The details for this script can be found below:
#!/bin/bash
for ((i=1; i<=10; i+=1))
do
jobname=Multi-Job_$i
cat << EOF | qsub
###### Select resources #####
#PBS -N $jobname
#PBS -l ncpus=1
#PBS -l mem=1g
##### Queue #####
#PBS -q workq
########## Output File ##########
#PBS -o \$PBS_O_WORKDIR/$jobname.txt
########## Error File ##########
#PBS -e \$PBS_O_WORKDIR/$jobname.err
##### Change to current working directory #####
cd \$PBS_O_WORKDIR
##### Execute Program #####
./hello.exe
EOF
done
Footer Artwork: Billabong Camp — People and Meeting Places
CQUniversity Australia is a trading name of Central Queensland University
ABN: 63 944 888 667
RTO Code: 40939
CRICOS: 00219C
TEQSA: PRV12073