Versions Compared

Key

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

...

  • Be notified when the job starts, use the -m option eg be sent an email if the job is aborted, when it begins, and when it ends: #PBS -m abe

  • Give the job a name: To find your job in a long list give it a meaning name with the -N option: #PBS -N MyJob01

  • Merge the error file into the standard output file: #PBS -j oe

  • Overriding the email address: If you want to send the job notification email to another address, use the -M option, eg #PBS -M bob@bob.com

Another example

From the Introduction to the Unix Shell for HPC users course lets run the do-stats.sh script as a job

Code Block
#!/bin/bash -l
#PBS -N GooStatsRun01
#PBS -l select=1:ncpus=1:mem=2gb
#PBS -l walltime=00:30:00
#PBS -m abe
cd $PBS_O_WORKDIR

# Calculate stats for data files.
for datafile in NENE*A.txt NENE*B.txt
do
    echo $datafile
    bash goostats.sh $datafile stats-$datafile
done

Call this do-goostats.pbs

Now submit to the scheduler:

Code Block
qsub do-goostats.pbs

And check the status:

Code Block
qjobs

When run, check the output:

Code Block
ls -ltr
cat GooStatsRun01.o{job_id}
...
CPU time  : 00:00:00
Wall time : 00:00:33
Mem usage : 4648kb
cat GooStatsRun01.e{job_id}
{Empty File}

Tricks and Tips

When the job starts, PBS will logon to the node as you and your working directory will be your home folder. If your data is in a sub folder or in a shared folder, you can use this to automatically change to that folder:

...