Mathematica

To run Mathematica from PBS, type:

module load mathematica

Next create an input file containing the Mathematica commands. The first line in this file must be AppendTo[$Echo, "stdout"] and the last line must be Quit[];

An example input file,name it m.inp:

AppendTo[$Echo, "stdout"]
2 + 1
Expand[(x - 1)^8]
x = 2
Quit[];

Then submit a script, such as the one below,

qsub ex.scr

#PBS -N mathe_test
#PBS -q route
#PBS -l nodes=1:ppn=1,walltime=24:00:00
#PBS -S /bin/bash
#PBS -M your-email-address
#PBS -m abe
#PBS -V
#
echo "I ran on:"
cat $PBS_NODEFILE
#
#cd to your execution directory first
cd /home/your-user-name
#
math < m.inp > m.out
#